Hi, I want to fix bodies in mid air, but I do not want to them to be fixed in the x or z component. At the moment, I'm using an action, here is the applyAction
force.setMul4(-1,rb->getWorld()->getGravity() ); force.setMul4(rb->getMass(),force); // Apply the gravity force. if(rb->getPosition()(1) < mOldPos(1)) { rb->setLinearVelocity(hkVector4(rb->getLinearVelocity()(0),0,rb- >getLinearVelocity()(2)) ); rb->applyForce( stepInfo.m_deltaTime, hkVector4(0,force(1),0) ) ; }
This works, but I would prefer to just balance the forces, however if I do that the box rises.
Stopping bodies falling.
Hi, I want to fix bodies in mid air, but I do not want to them to be fixed in the x or z component. At the moment, I'm using an action, here is the applyAction
force.setMul4(-1,rb->getWorld()->getGravity() ); force.setMul4(rb->getMass(),force); // Apply the gravity force. if(rb->getPosition()(1) < mOldPos(1)) { rb->setLinearVelocity(hkVector4(rb->getLinearVelocity()(0),0,rb- >getLinearVelocity()(2)) ); rb->applyForce( stepInfo.m_deltaTime, hkVector4(0,force(1),0) ) ; }This works, but I would prefer to just balance the forces, however if I do that the box rises.