Help after upgrading to Newton 2

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Help after upgrading to Newton 2

Postby Skarik » Tue Oct 06, 2009 6:57 pm

Just upgraded project from Newton 1.53 to Newton 2.10.

It's, um, working awesome except for one thing.

When stuff hits the ground, the * hits the fan. Litterally.

I got a box, and it's bouncing on Steroids. What's up, what's possible causes?
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm

Re: Help after upgrading to Newton 2

Postby Julio Jerez » Tue Oct 06, 2009 7:16 pm

that kind of vage it need more detail.
what are you doing?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Help after upgrading to Newton 2

Postby Skarik » Tue Oct 06, 2009 7:21 pm

I have no idea.

Code: Select all
// This is the function you change to change gravity
// If you want zero gravity volumes, you'll have to
// ask me to do it for ya. It takes a bit of list shifting
// to get to the volume.
// BTW, this function was copied straight from Irrlicht.
// All I did was make it use U3D's coordinate system.
void PhysUtilApplyGravity( const NewtonBody * pNewtonBody, dFloat timestep, int threadIndex )
{
   dFloat Ixx;
   dFloat Iyy;
   dFloat Izz;
   dFloat mass;

   // Set gravity force
   NewtonBodyGetMassMatrix( pNewtonBody, &mass, &Ixx, &Iyy, &Izz );
   CVect vectForce (0.0f, 0.0f, mass * -98.1f );

   // Get user defined forces ( Not from irrlicht )
   if ( NewtonBodyGetUserData( pNewtonBody ) != NULL )
   {
      CBaseObject * pTargetObject;
      pTargetObject = (CBaseObject * ) NewtonBodyGetUserData( pNewtonBody );
      vectForce += *(pTargetObject->GetSuperControlEverythingForce());
   }

   // Add the force
   NewtonBodyAddForce ( pNewtonBody, vectForce.GetVectorPtr() );
}


That's what I look at.

Now, I'm thinking it's the solver in 2.x, since this is the same * I used to get with Newton. The weird part is, though, that the player doesn't do that, possible as a result of the pin vector constraint, which rocks by the way.

Hey, I'll do some more hacking around with the solver types and see if anything works.

I'm also wondering about thread index. What is that? Also, there's a new argument with shapes, what is that?
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm

Re: Help after upgrading to Newton 2

Postby Skarik » Tue Oct 06, 2009 7:24 pm

I was right.

I changed the solver model, and it works perfectly now. I'd like to know, though, what has changed in that function since I can't seem to find a good help file for Newton 2.x. Also, my questions from above still persist.
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm

Re: Help after upgrading to Newton 2

Postby Skarik » Tue Oct 06, 2009 7:27 pm

I take it back, the object still goes crazy when another object - the player - crashes into it.

Edit:

I don't think it's possible for a box to jump by itself that many times of its own accord.
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm

Re: Help after upgrading to Newton 2

Postby JernejL » Wed Oct 07, 2009 4:31 am

Skarik wrote:I don't think it's possible for a box to jump by itself that many times of its own accord.


It isn't, you definetly apply some force to cause that, it may be some broken upgraded forcetorque or joint code.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Help after upgrading to Newton 2

Postby Skarik » Wed Oct 07, 2009 7:23 pm

Right, I'll tell the guys working on the physics to check the force applying functions.
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm

Re: Help after upgrading to Newton 2

Postby Skarik » Sat Oct 10, 2009 8:13 pm

Right, it's still doing the same. Gravity works fine, it's only when colliding with a static object, it goes effing nuts.
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm

Re: Help after upgrading to Newton 2

Postby JernejL » Sun Oct 11, 2009 3:56 am

Provide a run-able demo or something, we can't solve a problem from just words "it doesn't work", especially when it's very likely that this is triggered by a bug in your app code.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Help after upgrading to Newton 2

Postby Skarik » Sun Oct 11, 2009 7:50 pm

Ya I know, but I gotta put it together, and I'm just oh so lazy.

Blast, I'll put a demo or something at least before the week is over.
Skarik
 
Posts: 11
Joined: Mon Aug 03, 2009 5:31 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests