DIF Files Cause PhysX Collision Logic to Crash - LOGGED
by Philip J. Stroh · in Torque 3D Professional · 02/01/2011 (11:14 am) · 11 replies
I have some old DIF files that are causing Torque to crash when PhysX is enabled.
It is failing the following assert:
"AssertFatal( !((PxCollision*)shape)->getShapes().empty(), "PxBody::init - Got empty collision shape!" );"
in the bool PxBody::init function in the pxBody.cpp file.
Is there anyway around this? Or do I need to convert the DIF files into DTS or Collada?
Also, if I do have to convert the DIF files, what is the easiest way? Thanks.
It is failing the following assert:
"AssertFatal( !((PxCollision*)shape)->getShapes().empty(), "PxBody::init - Got empty collision shape!" );"
in the bool PxBody::init function in the pxBody.cpp file.
Is there anyway around this? Or do I need to convert the DIF files into DTS or Collada?
Also, if I do have to convert the DIF files, what is the easiest way? Thanks.
About the author
Companies I worked for: VTSG: F16 simulations. Simigon: Primarily F16 simulations. Veraxx: 2D simulation called the TEN. Valador: DON, plus new Torque projects. I served in U.S. Marine reserves for a little more than 9 years in an infantry unit.
Recent Threads
#2
What are the different types of interior instances you can have?
02/17/2011 (11:25 am)
I created a collada model to replace the interior instance (.dif file), but now all my objects are kind of shaking inside the simulation (jittery).What are the different types of interior instances you can have?
#3
02/17/2011 (12:22 pm)
Is there a way to tweak your collision forces? Or give a "cushion" of some sort? Usually there is an epsilon value used to prevent jitter in close contact physics sims....
#4
It happens when I use a collada building model instead of a DIF building model.
All the objects inside the collada building model jitter, but when I load the level without the collada building model, then the jittering stops.
It's not just physics objects that jitter, but all types of objects.
02/17/2011 (12:26 pm)
I do have objects that are within close proximity of each other and I don't have the jittery objects.It happens when I use a collada building model instead of a DIF building model.
All the objects inside the collada building model jitter, but when I load the level without the collada building model, then the jittering stops.
It's not just physics objects that jitter, but all types of objects.
#6
these are my unsupported observations while doing similar structures.
you will need a lot of planning when doing buildings to support these kinds of things.
03/15/2011 (2:40 pm)
the reason they jitter is cause if the collada building is a physics object, the other physics objects are within its physics collision bounds, if you understand, a physics object inside a physics object will try to displace its-self to outside the object, thats physics.these are my unsupported observations while doing similar structures.
you will need a lot of planning when doing buildings to support these kinds of things.
#7
It turns out that the jittery effect I'm seeing is my player model. If I click F8 to go into camera mode, then click F7 to go back to player mode, then the jittery goes away.
It seems like when I first load the mission, the player is placed a little below the floor of the building model, just slightly, but that seems to be causing the jittery effect.
03/16/2011 (6:13 am)
I created the office building as a TSStatic object using a Collada model.It turns out that the jittery effect I'm seeing is my player model. If I click F8 to go into camera mode, then click F7 to go back to player mode, then the jittery goes away.
It seems like when I first load the mission, the player is placed a little below the floor of the building model, just slightly, but that seems to be causing the jittery effect.
#8
I'm looking at this bug now.
Can you please email me the old DIF that was causing the PhysX issue at tom@sickheadgames.com. I don't need anything other than the one .DIF file... no materials or textures.
04/01/2011 (10:03 am)
@PhilipI'm looking at this bug now.
Can you please email me the old DIF that was causing the PhysX issue at tom@sickheadgames.com. I don't need anything other than the one .DIF file... no materials or textures.
#10
In engine/source/interior/interiorInstance.cpp around line 248:
That should do it. Thanks for the report Philip!
04/06/2011 (9:58 pm)
Fixed for 1.1.In engine/source/interior/interiorInstance.cpp around line 248:
if ( PHYSICSMGR && mInteriorRes && mInteriorRes->getNumDetailLevels() > 0 ) // MODIFIED!
{
// TODO: We need to cache the collision by resource name
// and reuse it across multiple instances.
// Get the interior collision geometry.
ConcretePolyList polylist;
mInteriorRes->getDetailLevel(0)->buildPolyList( &polylist,
Box3F(999999.0f), MatrixF::Identity, getScale() ); // MODIFIED!
polylist.triangulate();
if ( !polylist.isEmpty() ) // ADDED!
{
// Use a triangle mesh for collision.
PhysicsCollision *colShape = PHYSICSMGR->createCollision();
colShape->addTriangleMesh( polylist.mVertexList.address(),
polylist.mVertexList.size(),
polylist.mIndexList.address(),
polylist.mIndexList.size() / 3,
MatrixF::Identity );
PhysicsWorld *world = PHYSICSMGR->getWorld( isServerObject() ? "server" : "client" );
mPhysicsRep = PHYSICSMGR->createBody();
mPhysicsRep->init( colShape, 0, 0, this, world );
mPhysicsRep->setTransform( getTransform() );
} // ADDED!
}That should do it. Thanks for the report Philip!
#11
04/08/2011 (10:05 am)
Thanks a lot Tom! I appreciate it:)
Associate Scott Burns
GG Alumni
You can export your DIFs to DAE from within the world editor though. That feature is available via File->Export Interiors to Collada. It'll bring up a window with the DIFs that loaded and you can select which ones to export.