SIO2object->_SIO2objectphysic initialization
2 posters
SIO2object->_SIO2objectphysic initialization
I've created physic objects and before I added bounds in blender the program compiled fine and physics objects were duplicating fine.
Now that I added a triangle mesh bound to the parent object in blender and I attempt to duplicate the object it duplicates fine, but when I attempt to run sio2PhysicAddObject on the duplicated object I'm finding that _SIO2object->_SIO2objectphysic->_btRigidBody is not initialized, and searching through tutorial06-* I can't find anything different in the initialization of the physic objects. I'm still familiarizing my self with Bullet so it might be something simple I'm overlooking.
Does anyone know why this might be or know what I might have forgotten?
Thanks in advance
Now that I added a triangle mesh bound to the parent object in blender and I attempt to duplicate the object it duplicates fine, but when I attempt to run sio2PhysicAddObject on the duplicated object I'm finding that _SIO2object->_SIO2objectphysic->_btRigidBody is not initialized, and searching through tutorial06-* I can't find anything different in the initialization of the physic objects. I'm still familiarizing my self with Bullet so it might be something simple I'm overlooking.
Does anyone know why this might be or know what I might have forgotten?
Thanks in advance
mordenkaim- Posts : 21
Join date : 2009-05-19
Re: SIO2object->_SIO2objectphysic initialization
Check tutorial061 for duplication... depending on the bound type you might need to map the vertex buffer of the object (like for convexhull or trianglemesh)...
Re: SIO2object->_SIO2objectphysic initialization
Based on the comments in tut061 it sounds like you only need to use hard copy to have access to the vertices which I'm using.. This is the code that worked prior to adding a trianglemesh bound to the parent object. Once I added it the sio2PhysicAddObject began to throw an EXC_BAD_ACCESS because it was trying to reference a null object. It must be the vertices like you say but I'm not certain what else needs to be done in order to make them accessible. Is there something I'm missing?
- Code:
//source is previously defined as a parent SIO2Object
//gameMatrix is a multi dimensional array of SIO2Objects
sprintf(name,"%s_%d_%d",source->name,colInt,rowInt);
gameMatrix[colInt][rowInt]=sio2ObjectHardCopy(source,name); //duplicate
//move the objects to desired location, setting them up in a grid
gameMatrix[colInt][rowInt]->_SIO2transform->loc->x=(colInt-(numCols/2))*(source->rad * 1.5f);
gameMatrix[colInt][rowInt]->_SIO2transform->loc->z=(rowInt-(numRows/2))*(source->rad * 1.5f);
sio2TransformBindMatrix(gameMatrix[colInt][rowInt]->_SIO2transform);
//move complete, now add it as a physic object
if( gameMatrix[colInt][rowInt]->_SIO2objectphysic->bounds == SIO2_PHYSIC_TRIANGLEMESH )
sio2PhysicAddObject(sio2->_SIO2physic,gameMatrix[colInt][rowInt]);
mordenkaim- Posts : 21
Join date : 2009-05-19
Similar topics
» Duplicate / clone SIO2Object with new material
» SIO2object::col
» Deep copies of SIO2object
» Collection/Container for SIO2Object
» What is the Correct Way to Delete an SIO2Object?
» SIO2object::col
» Deep copies of SIO2object
» Collection/Container for SIO2Object
» What is the Correct Way to Delete an SIO2Object?
Permissions in this forum:
You cannot reply to topics in this forum