Game Development Community

DTS objects and Raycasting

by Ronald J Nelson · in Torque Game Engine · 12/13/2006 (4:41 am) · 11 replies

Is there some way to get the RInfo information in a RayCast from a the visible mesh portion of a DTS object, rather than its bounding box or collision mesh?

I can see that the lighting has some way of doing this since it is "illuminating" the polygonal areas of the visible mesh. However I have no idea where to even find the area it does this. I have been looking and have probably just missed it.

Thank you for any help you can give me.

#1
12/13/2006 (9:32 am)
Lighting does not use raycasts: videocards just do not work this way. The vertex colors are simply calculated based on distance to light and the dot product between the vector to the light and the vertex normal, and this is done by the GPU/driver, TGE does not do this manually.

You cannot use the build-in raycast code to cast rays on the visible mesh, because it's not convex. The raycast code assumes convex geometry. You'll need to code in a new ray tracing function which tests the ray against individual triangles.
#2
12/13/2006 (10:21 am)
This resource has some code in it to do special raycasts against the visible portions of a DTS mesh. You may be able to adapt it.
#3
12/13/2006 (10:57 am)
Manoel- Thanks for that, I just learned something new.

Tom- Thanks but that is apparently a TSE resource, I only own TGE.
#4
12/13/2006 (3:16 pm)
Dave Young shared his version with me so I could try to convert it to something for TGE, I have to admit after using Winmerge to look at the code there is so much extra code in there for his game that is obviously no it, I am having trouble discerning what is the actual resource.
#5
12/25/2006 (2:55 pm)
OK Tom Spilman told me the code should have been in there to do this, I have looked everywhere other than a collision exeption system (which might be it) I have no idea what the code is. If it is fact the collision exemption, I have no idea how to use it.
#6
12/25/2006 (3:35 pm)
I just released a polysoup resource (which lets you do full collision against the visible mesh, including raycasts) as a resource for TSE licensees. The code works fine with TGE.
#7
12/25/2006 (7:03 pm)
Well thats great Ben and sounds like it is exactly what I needed. But I am still just a TGE owner.
#8
12/26/2006 (2:46 am)
I also am just a TGE owner but would LOVE to look at the 'polysoup' code, for nothing less then to see how it works. If it works fine with TGE, might we some time get to see a TGE polysoup resource?
#9
12/28/2006 (7:09 pm)
If the resource isn't using anything specific to TSE, shouldn't we be able to see it and use it in TGE?

I'd be very interested in this too. Would pick up TSE but we still have to support Macs.
#10
12/29/2006 (1:37 am)
Ben has already said in his blog he will release it shortly after New Years to TGE users.
#11
12/29/2006 (11:53 am)
Excellent news to ring in the New Year