Game Development Community

castRay not working with PhysicalZones

by Mark Smithh · in Torque Game Engine · 10/16/2002 (10:30 am) · 6 replies

I am using PhysicalZones in my game (Torque 1.1.2), and they work fine colliding with the players, but when I call castray with a mask of PhysicalZoneObjectType it always fails. I have been trying to figure out why, but no luck yet. Someone else wanna help me look at this one?

Thanks--

Mark

#1
11/02/2002 (12:40 pm)
I found that dts objects without collision meshes dont seem to be detected.
#2
11/12/2002 (1:55 pm)
When you call castRay on a container, it in turn calls castRay on any contained objects. Since PhysicalZone does not have a defined castRay method, invoking castRay on a PhysicalZone object would fall back to SceneObject::castRay, which returns false.

So it looks like to make PhysicalZone detectable by castRay, you need to write a PhysicalZone::castRay method. Check some of the other castRay methods to see how it's expected to perform.
#3
01/29/2004 (12:58 pm)
Anyone ever work on this? A PZ should be raycast-able...

-s
#4
01/29/2004 (6:41 pm)
I disagree ;)

A physical zone is a zone which affects objects but is not directly interactable with. Like an area of null gravity, for instance.
#5
02/03/2004 (10:15 am)
I added in a castRay method to the PZs that basically just calls the line collision (i think thats what it was) method on the object box. I am using it to effect projectiles. It seems to work...
#6
08/23/2013 (8:54 pm)
Just noting that I found this thread very helpful and copied the raycast from Triggers into Zones.