void PhysicsObject::ApplyForwardForce(float force)
{
//forward_vel+=force/mass;
int n_id;
for (unsigned int i = 1; i < OBJECT_LIMIT; i++)
{
n_id = i;
if (!dbObjectExist(i))
break;
}
dbMakeObjectPlane(n_id, 1.0f, 1.0f);
dbSetObjectToObjectOrientation(n_id, id);
dbPositionObject(n_id, dbObjectPositionX(id), dbObjectPositionY(id), dbObjectPositionZ(id));
dbMoveObject(n_id, force);
float len = sqrt(dbObjectPositionX(n_id) * dbObjectPositionX(n_id) + dbObjectPositionY(n_id) * dbObjectPositionY(n_id) + dbObjectPositionZ(n_id) * dbObjectPositionZ(n_id));
float new_x = dbObjectPositionX(n_id) - dbObjectPositionX(id);
float new_y = dbObjectPositionY(n_id) - dbObjectPositionY(id);
float new_z = dbObjectPositionZ(n_id) - dbObjectPositionZ(id);
new_x/=len;
new_y/=len;
new_z/=len;
dbDeleteObject(n_id);
vel_x+=new_x / mass;
vel_y+=new_y / mass;
vel_z+=new_z / mass;
}
It\'ll move... once. After using the function once, it stops working. The plane is still created and positioned correctly and everything, but velocity doesn\'t change.