Saturday, 17 August 2013

Bullet physics crashing because of invalid reference?

Bullet physics crashing because of invalid reference?

I'm making a game with bullet physics where I have a Platform class, which
contains a btBoxShape, btDefaultMotionState and a btRigidBody as members.
When exiting my game it crashes. I store the Platform objects in an
std::vector, and I think this is the problem. When I push back more
Platforms, the vector resizes and moves in memory. This means that
whatever pointer to the shape and motionstate that the rigid body has is
invalidated. How should I solve this?

No comments:

Post a Comment