when I run it in single perdition I see a lot of camera flicker, the pilar does no stay put, if fall over teh size.
Is that the problem?
I am late for work now, I will check later, but please tell of this what teh problem is supposed to show?
Moderators: Sascha Willems, walaber
// add force and torque to rigid body
void PhysicsApplyGravityForce (const NewtonBody* body, dFloat timestep, int threadIndex)
{
dFloat Ixx;
dFloat Iyy;
dFloat Izz;
dFloat mass;
#if 0
NewtonBodyGetMass(body, &mass, &Ixx, &Iyy, &Izz);
dVector dir(0.0f, 1.0f, 0.0f);
dVector force(dir.Scale(mass * DEMO_GRAVITY));
NewtonBodySetForce(body, &force.m_x);
#else
NewtonWorld* const world = NewtonBodyGetWorld(body);
DemoEntityManager* const scene = (DemoEntityManager*)NewtonWorldGetUserData(world);
bool bThrust = false;
if (scene->GetKeyState(' ')) {
bThrust = true;
}
NewtonBodyGetMass(body, &mass, &Ixx, &Iyy, &Izz);
// mass in "MishosRocketTest" is set to one million kg
dVector force(dVector(0.0f, 1.0f, 0.0f).Scale(mass * DEMO_GRAVITY)); // Force calculated here is 9.8 million N
// Misho added
dVector thrust(dVector(0.0f, 1.0f, 0.0f).Scale(0.0));
if (bThrust)
thrust = dVector(0.0f, 1.0f, 0.0f).Scale(10000000.0); // ten million newtons, so the bodies will "rise" slowly...
else
thrust = dVector(0.0f, 1.0f, 0.0f).Scale(0.0); // ten million newtons, so the bodies will "rise" slowly...
dVector resultant = thrust + force;
NewtonBodySetForce(body, &resultant.m_x);
#endif
}
Julio Jerez wrote:when I run it in single perdition I see a lot of camera flicker, the pilar does no stay put, if fall over teh size.
Is that the problem?
I am late for work now, I will check later, but please tell of this what teh problem is supposed to show?
Julio Jerez wrote:Also do not forget to tell me if the change to the it ill is necessary, you did not put that file in the link
Julio Jerez wrote:Are you getting better results?
misho wrote:From the looks of it, I seem to be able to use DemoEntity as a generic object in almost any application, as in, I don't have to remove all of the openGL or Mesh functionality, since my display system doesn't use those, correct?
Users browsing this forum: No registered users and 1 guest