Collision Mesh

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Collision Mesh

Postby adam450 » Sat Jan 30, 2010 4:55 pm

For plenty of games that have bullets, there are duplicate collision meshes: example: a statue.

Your collision meshes cannot have an orientation in the world. I'm wondering if you updated this to allow this?

My idea: Internally in Newton, take a collision mesh and compute and AABB. If they ray intersects the AABB, perform the ray trace how you currently do it. If I have a thousand statues, I don't want to create 1000 collision meshes. So have the ray test against the internal AABB of these collision meshes in world space. If it hits, you simply put the Ray in the Collision Mesh space, compute a time for intersection. Multiply that time of intersection by the world space ray and you have a collision.

I hope you understood what I meant. Basically if I have 1,000 of the same statue, it would take forever to transform those vertices on the CPU and then send them as individual meshes. Also wastes memory.

Maybe I as a user am supposed to create this scenerio? I guess I could.
adam450
 
Posts: 21
Joined: Fri Jan 16, 2009 11:11 pm

Re: Collision Mesh

Postby Julio Jerez » Sat Jan 30, 2010 5:09 pm

I undenstand the idea, but that is how the collision system works.
each object leve is one or more cell in a mutiresoluion grid, ther ray only trace objects if tehr interse a cell that is ocuppy by at least one object.
This is in effect the same you are proposing.

Plus a shape is selected for casting, depending of the shape, a ray do a checck against the AABB before they do any actual ray test on the shape.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Collision Mesh

Postby adam450 » Sat Jan 30, 2010 8:39 pm

Well for collision meshes, it says you cant have a matrix.

So should I implement what I suggested? If a statue say is 100 triangles, and I have 1000 statues, should I simply ray cast the aabb of all 1000. Upon getting a list of those, I would then raycast in a separate newton world that only holds the statue mesh and just ray cast that collision mesh?
adam450
 
Posts: 21
Joined: Fri Jan 16, 2009 11:11 pm

Re: Collision Mesh

Postby JernejL » Sun Jan 31, 2010 12:35 am

You are mistaking two things, a collision is the collision object itself, the body is a instance of that collision with its own rotation and position, is that not exactly what you need?!
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Collision Mesh

Postby adam450 » Sun Jan 31, 2010 2:53 am

Never mind then. I never needed to use it until now so I wanted to figure it out first. When reading the tutorial a long time ago it mentioned that something about setting a matrix for a collision mesh would not apply it or something. Sorry.
adam450
 
Posts: 21
Joined: Fri Jan 16, 2009 11:11 pm

Re: Collision Mesh

Postby JernejL » Sun Jan 31, 2010 10:05 am

adam450 wrote:Never mind then. I never needed to use it until now so I wanted to figure it out first. When reading the tutorial a long time ago it mentioned that something about setting a matrix for a collision mesh would not apply it or something. Sorry.


you can apply transformations to collisions inside a 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: Collision Mesh

Postby Julio Jerez » Sun Jan 31, 2010 11:23 am

Adam in Netwon 2.00 there is a SceneCollision object, you can make your 100 statue triangles, place the numbet of time you want in a scene collision.
scene collision are like static compound collision and the take collision trees as sub shapes.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
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 44 guests