Game Development Community

How easy are line-of-sight checks in TGE?

by John Klimek · in General Discussion · 05/01/2006 (12:48 pm) · 1 replies

I'm thinking about buying TGE and I've already been told that it's possible to do line-of-sight (LOS) checks in TGE but I'm wondering how complicated they are.

For example, let's say I want something to happen when a player see's another player killing somebody. So for example I'd assume that I'd trigger a "death event" when the death occurs but then I'd have to see if anybody nearby players saw the death.

How complicated is this? I realize that TorqueScript itself can't be posted in here, but I'm wondering how easy/simple this would be to code...

#1
05/01/2006 (12:53 pm)
You just do a raycast after setting the flags you want for which objects to collide with. In the case you mention, you want to do a cast from the observer's eye node to probably the bounding box of both targets to observe (2 cast in other words), and see if anything else collides with the ray first, but that's just one example.