physics thread problem

Go down

physics thread problem

Post  sctm81 on Tue May 12, 2009 3:02 am

I am using a thread like templatePhysicCullingThread( void *_ptr ) in tutorial 6_2 to call the functions

sio2PhysicRender( sio2->_SIO2physic, 1.0f / 60.0f, 1 );
sio2ResourceCull( _SIO2resource, sio2->_SIO2camera );

to simulate the physics of 2 objects. For some reason the simulator runs for 1 second and then gets stuck at an unidentified location. Any clues anyone? Do I need an extra sleep command in the thread?


Posts : 29
Join date : 2009-04-24

View user profile

Back to top Go down

Re: physics thread problem

Post  sio2interactive on Tue May 12, 2009 3:46 am

Are you messing around with the btRigidBody in the main thread? Cuz Bullet is not thread safe... The only operation that you are allowed to do is read the matrix... any other write operation handled by Bullet will result into a segfault.

SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch

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

View user profile

Back to top Go down

Back to top

- Similar topics

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