Game Development Community

Attempting simple destructible object in Torque3D

by Tyler · in Torque 3D Beginner · 04/24/2016 (10:32 pm) · 1 replies

So, I imported an fbx of a pillar into 3ds max, I followed the destructibles tutorial so had the unbroken model, then copied a new one on top of it and cut the new one up into five pieces. I added a box shape around the entire unbroken model for bounds, and I added boxes around each chunk for colboxes (including another big box around the whole thing for the colbox of the unbroken model. The collision dummy nodes are all little squares at pivot 0.0.

Anyway, I added the two datablocks from the tutorial at the end of physicsShapes.cs (it seemed to be a c file in my folder?) and modified to take my unbroken pillar and broken pillar. However, in Torque world editor, when I go to datablock editor and click PhysicsShapeData to add a PhysicsShapeData (My unbroken pillar), nothing happens. I click confirm after naming it and nothing appears...

If I add PhysicsDebrisData that works... After naming it it shows in up in my added datablocks and I can set the broken pillar model to it.

When I open the shape editor for the broken and unbroken pillar in torque (Both models located in art/shapes/physicsShapes) they appear and the broken one is split into chunks. However, when I try to double click and add either to my terrain, they are just invisible nothings...

Here are my datablocks in physicsShapes:

datablock PhysicsDebrisData( PSpillardebris )
{
lifetime = 60.0;
lifetimeVariance = 0.0;
velocity = 0.1;
velocityVariance = 0;
shapeFile = "art/shapes/physicsShapes/pillar_bk_100.DAE";
mass = 10;
dynamicFriction = 0;
staticFriction = 0.3;
restitution = 0.0;
linearDamping = 0.1;
angularDamping = 0.1;
linearSleepThreshold = 1.0;
angularSleepThreshold = 1.0;
waterDampingScale = 10;
buoyancyDensity = 0.8;
friction = "0.2";
};

datablock PhysicsShapeData( PSpillarshape )
{
category = "PhysicsShape";
shapeName = "art/shapes/physicsShapes/pillar_unbk_100.DAE";
mass = 10;
debris =PSpillardebris;
explosion = "SplinterExplosion";
friction = "1";
linearDamping = "0.1";
angularDamping = "0.1";
buoyancyDensity = "0.2";
staticFriction = "0.1";
restitution = "0.3";
invulnerable = "0";
minDamageAmount = "1.25";
};

Both the main physicsShapes and the physicsShapes header were copied into the physicsShapes folder containing my broken and unbroken model.

Tutorial I was following: http://www.garagegames.com/community/forums/viewthread/119211/3

I wanted to show my schematic view for setting up the nodes, but can't see where to add a photo... But the hierarchy is:
bounds

base
-collision-01
-collision-02
-collision-03
-collision-04
-collision-05
-collision-06
-start
--Brick-unbk100
---colbox-1
--Brick-bk-one100
---colbox-2
--Brick-bk-two100
---colbox-3
--Brick-bk-three100
---colbox-4
--Brick-bk-four100
---colbox-5
--Brick-bk-five100
---colbox-6
-detail100

I would really love some help on how to set up the datablocks in torque because PhysicsShapeData seems to not be working and how to actually get the shapes to show up and be destroyable

**Update: Got the models loaded into the game, but PhysicsShapeData is still not working so nothing is destroyable yet.

Thank you!

About the author

Recent Threads


#1
04/25/2016 (6:57 pm)
Hello Tyler ,
Im neither T3d user nor very skilled with any torque related product but , the brainy one who wanders in might want to know what the log file has to say . Perhaps , if you want , you can insert a couple of echoes where that object gets created and/or added , find the message in your log file and investigate the circumstances . have a nice day