FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

SIO2object->_SIO2objectphysic initialization

2 posters

Go down

SIO2object->_SIO2objectphysic initialization Empty SIO2object->_SIO2objectphysic initialization

Post  mordenkaim Tue Aug 25, 2009 9:29 pm

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 Smile

mordenkaim

Posts : 21
Join date : 2009-05-19

Back to top Go down

SIO2object->_SIO2objectphysic initialization Empty Re: SIO2object->_SIO2objectphysic initialization

Post  sio2interactive Tue Aug 25, 2009 9:33 pm

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)...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

SIO2object->_SIO2objectphysic initialization Empty Re: SIO2object->_SIO2objectphysic initialization

Post  mordenkaim Tue Aug 25, 2009 11:02 pm

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

Back to top Go down

SIO2object->_SIO2objectphysic initialization Empty Re: SIO2object->_SIO2objectphysic initialization

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum