is there any suggestion for a "nan" problem?

zzcn
Posts: 20
Joined: Tue Nov 04, 2008 1:50 pm

is there any suggestion for a "nan" problem?

Post by zzcn »

it is a very simple dynamicsworld(setGravity(0,0,-10)) with just on dynamic rigidbody, at the position (0,0,100),
i call the stepSimulation,then print out the position of the rigidbody. they all are "nan".

can anyone give me some clue that cause this problem?

thx..
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: is there any suggestion for a "nan" problem?

Post by pico »

zzcn wrote:it is a very simple dynamicsworld(setGravity(0,0,-10)) with just on dynamic rigidbody, at the position (0,0,100),
i call the stepSimulation,then print out the position of the rigidbody. they all are "nan".

can anyone give me some clue that cause this problem?

thx..
Does this happen after just one stepSimulation or after several steps?
Do the bodies rest on a ground or do they fall into infinity?
zzcn
Posts: 20
Joined: Tue Nov 04, 2008 1:50 pm

Re: is there any suggestion for a "nan" problem?

Post by zzcn »

oh..there is only one obejct, and it do falls into the infinity...

i should add a ground into it and try again.

thx a lot..

kun
zzcn
Posts: 20
Joined: Tue Nov 04, 2008 1:50 pm

Re: is there any suggestion for a "nan" problem?

Post by zzcn »

i added a "ground"(static btRigidBody) into the world.
but after the stepSimulation(1.f/60.f, 60) the dynamics object's position is still "nan"

is there still any other possible clue?

thx. for any suggestions.

kun
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: is there any suggestion for a "nan" problem?

Post by Erwin Coumans »

Is the NAN already there before adding the object to the world, or before stepSimulation?

Did you initialize the world transform correctly? Do you get the NAN from the rigidbody or motionState?

Can you reproduce this in any of the Bullet demos?
Thanks,
Erwin
zzcn
Posts: 20
Joined: Tue Nov 04, 2008 1:50 pm

Re: is there any suggestion for a "nan" problem?

Post by zzcn »

i checked the position before the stepSimulation from the motionstate, it's still (0,0,100)
after simulation it becomes (nan, nan, nan)

i am doing something with bullet, that runs on different computer, works with a game engine. I write some test program to check out my idea.
Maybe i did something wrong with the network communication part that causes this problem, I will try to find it out and replay it here.

thx again.

kun
zzcn
Posts: 20
Joined: Tue Nov 04, 2008 1:50 pm

Re: is there any suggestion for a "nan" problem?

Post by zzcn »

ye...i found the reason, i did something wrong here, set the basis matrix in the btTransform not correctly...
sorry and thx anyway.

i still have one small question, need some help here.
i have two dynamicsworld, one at the server side, do the really physic computing, another at the client site, which just works more like a proxy, with game engine together. after the simulation, server send the following rigidbody's data back:

linearvelocity
angularvelocity
basis Matrix
origin

is these info enough to update the rigidbody on the client side? any help will be appreciated

thx!
kun