A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Goodjee » Mon Jun 22, 2009 3:59 pm
Hey Guys
I'm trying to add newton to my game but collision trees avoid to do the work they're supposed to do...
i'm dropping spheres but they dont stop at a xz-surface.
Here's some Code
- Code: Select all
Local plane:Float[]=[0.0,0.0,0.0, 350.0,0.0,0.0, 350.0,0.0,350.0, 0.0,0.0,350.0]
cityPhysics.collision = NewtonCreateTreeCollision(cityPhysics.world,Null);
NewtonTreeCollisionBeginBuild(cityPhysics.collision);
NewtonTreeCollisionAddFace(cityPhysics.collision, 4, plane, 12, 0)
NewtonTreeCollisionEndBuild(cityPhysics.collision, 0);
NewtonBodySetCollision(cityPhysics.rigidbody,cityPhysics.collision)
hope you can help
-
Goodjee
-
- Posts: 3
- Joined: Mon Jun 22, 2009 3:53 pm
by Julio Jerez » Mon Jun 22, 2009 4:03 pm
If this 1.53 then collison tree with one face will not work.
For SDK 2.0 thei had being fixed.
if you wnat to state with 1.53, you cna just add another dommy face and it will be fine.
I suggest you download 2.01 because it is much better.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Goodjee » Mon Jun 22, 2009 4:06 pm
its the newest version and it doesnt work with more faces or with triangles instead of quads
-
Goodjee
-
- Posts: 3
- Joined: Mon Jun 22, 2009 3:53 pm
by Julio Jerez » Mon Jun 22, 2009 5:48 pm
There are two issues.
The first is that function
cityPhysics.collision = NewtonCreateTreeCollision(cityPhysics.world,Null);
do not take and extra parameter in 2.02, you must call it like this:
cityPhysics.collision = NewtonCreateTreeCollision(cityPhysics.world);
The second is the face are single side in Newton, if the face normal point down the object will pass through, could you true inverting the winding like this:
- Code: Select all
Local plane:Float[]=[0.0,0.0,0.0, 0.0,0.0,350.0, 350.0,0.0,350.0, 350.0,0.0,0.0];
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Goodjee » Tue Jun 23, 2009 5:54 am
thank you...this would have taken days for me to find out on my own

-
Goodjee
-
- Posts: 3
- Joined: Mon Jun 22, 2009 3:53 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests