Jump to content

Unigine Fatal Error when BodyRigid::setMass() call


photo

Recommended Posts

Crash happen when I try set mass of RigidBody:

 

Object attachObject;

// in some function
BodyRigid body = attachObject.getBodyRigid();
body.setMass(20);

post-151-0-95257100-1291736951_thumb.jpg

Link to comment

You can't set mass to the rigid body directly.

RigidBody has "shape based" flag, and this parameter is enabled by default.

RigidBody automatically calculates own mass and inertia tensor from all assigned shapes when RigidBody is shape based.

Otherwise you should set mass and inertia tensor for BodyRigid when shape based flag is disabled.

Link to comment
×
×
  • Create New...