Using TreeCollisionGetVertexListTriangleListInAABB

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Using TreeCollisionGetVertexListTriangleListInAABB

Postby JernejL » Mon Apr 13, 2020 6:56 am

NewtonTreeCollisionGetVertexListTriangleListInAABB is suggested as being useable for projective texture shadows.

http://www.newtondynamics.com/wiki/inde ... ListInAABB

I did some experimenting, what i need is to make a lights system, so what i do is following:

- I call NewtonWorldForEachBodyInAABBDo in a area of interest
- From the list of trimeshes that intresect, i call NewtonTreeCollisionGetVertexListTriangleListInAABB on each of them, this gives me a set of face triangles.
- After this i use these triangles to generate 2d flat lines, and use that to cut a light area that a light would project on the map (so each ray of light)

The result looks like this, i can then generate vertices and uv coordinates and render a light from that: Image
FULL IMAGE: https://i.imgur.com/Lu1dEe4.png

I plan to do this for each light attached to vehicle once during transform callback, map lights will simply be calculated once when they come near view.

So what i am interested.. is this a good idea to use newton functionality for?
What will be the performance of NewtonWorldForEachBodyInAABBDo + NewtonTreeCollisionGetVertexListTriangleListInAABB - could i have problems with this?

Is there another way to put such workload into newton threads to benefit from parallelism without running it in transform callback?

Would size of map meshes or amout of these lights using NewtonTreeCollisionGetVertexListTriangleListInAABB affect performance?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 58 guests