Q: 2.x NewtonCreateCompoundCollision()

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Q: 2.x NewtonCreateCompoundCollision()

Postby Van » Fri Nov 13, 2009 9:37 pm

We are studying the NewtonCreateCompoundCollision(). The documentation is a little shy.

What sub-collision types are acceptable? Any type or is it limited to primitives? Can they be convex? Can they be Tree?
Stop Global Whining.
Van
 
Posts: 17
Joined: Mon Nov 08, 2004 12:36 am

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby Carli » Sat Nov 14, 2009 4:34 am

yes, that's a good question.
I'm planning to integrate Newton into a Script Engine and so I have to introduce 2 Datatypes: One that is a universal collision (for creating bodies) and one is a simple collision (for creating bodies _and_ for creating compound collisions (that are universal collisions))
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby Stucuk » Sat Nov 14, 2009 8:30 am

Compound Collisions are for adding other already created Collision's into one collision. Basicaly you create collisions with NewtonCreateBox(Or any of the others. Doesn't have to be just one type of collision object) for example, put the collision pointer you get from them in an array, and then send it to NewtonCreateCompoundCollision which will join them all up into one Collision Object.

Note: I don't know if you can use Tree Collisions and the regular (Movable) collision types in a compound collision at the same time.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby Julio Jerez » Sat Nov 14, 2009 9:44 am

compound collison take all of the closed shapes collision.

you can not add collision tres, terrains, or user collision since this can only be static
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby JernejL » Sat Nov 14, 2009 10:37 am

I've updated the NewtonCreateCompoundCollision wiki page using existing text there and some topics from the forum.
Hopefully i cleared up any issues about using this most awesome newton functionality :)
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby Julio Jerez » Sat Nov 14, 2009 12:29 pm

Delfi you may wan to fix this in teh forum

compound collisions in old version (pre-2.0) were instance objects that could not be shared among other rigid bodies. In Newton 2.0, this is no longer an issue - compound collisions may be reused/shared by multiple rigid bodies just like any other collision object.


in 2.0 compound collision are still isnacen object, but the fution create body make a copy of teh supahe tha was pass in.
Basically teh collision shape that is a signe to teh body is a copy o fteh compound collision.
an applictaion that keep to track collision shapes should get the collision pointer from the Body afet teh create the body, and not rely on the collision they are passing to the function create body.

but doing this Compounds work the same way as shared collision.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby JernejL » Sat Nov 14, 2009 1:39 pm

Ok, i added this info to wiki, i thought the collisions were same.. as i was using this in my spaceships game and there was absolutely no slowdown or whatever when creating multiple bodies using same compound collision.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Q: 2.x NewtonCreateCompoundCollision()

Postby Julio Jerez » Sat Nov 14, 2009 2:24 pm

the auter layer is different,
with the new change I made thes is no nessesary,
however now that I am wroking in the destritible, it goes back to the same dilema,
you if you make for exampel tow buildings wih the same collision then destruing one will do teh same to teh oether.

so the most flexible sultion is to share what is important like the leaves nodes that contain the convex shapes, and make a copy of teh nodes that are just pointers that supports the data.
It seems to be efficient that way.
also starting from 2.09 compound collision are much more effiecent than they has ever being.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests