Esempio n. 1
0
void csBulletRigidBody::AddForceAtPos (const csVector3& force,
    const csVector3& pos)
{
  if (!btBody)
    return; 

  btVector3 btForce (force.x * system->getInternalScale (),
		     force.y * system->getInternalScale (),
		     force.z * system->getInternalScale ());
  csOrthoTransform trans = csBulletCollisionObject::GetTransform ();
  csVector3 relPos = trans.Other2This (pos);

  btBody->applyImpulse (btForce, btVector3 (relPos.x * system->getInternalScale (),
					    relPos.y * system->getInternalScale (),
					    relPos.z * system->getInternalScale ()));
  btBody->setActivationState(ACTIVE_TAG);
}
Esempio n. 2
0
void bt_soft_body::apply_central_force(const vec3f &force)
{
	btVector3 btForce(force[0], force[1], force[2]);
	this->m_body->addForce(btForce);
}