Game Development Community

Area based castray?

by Cinder Games · in Torque Game Engine · 10/08/2005 (10:15 pm) · 4 replies

I did some searching and didn't seem to find what i was looking for.. perhaps i didn't use the right words.

I want to have a function where i can set a destination for a bot.. and have him avoid hitting things that might not exactly be in the exact strait line that a cast ray would do. picture a room with pillars... you may do a cast ray to see if the path is strait.. and it may be.. but when the bot starts moving.. he hits hit shoulder on the pillar.

Ok what i want is to do some sort cast ray function that checks not just a strait line.. but perhaps an area search wide enough to accomodate the width of the bot. I'm thinking i might have to just do multiple ray casts... but i was hoping there'd already be a solution.

#1
10/09/2005 (1:57 am)
Sure, that's what the buildPolyList/getConvex stuff is for. This is probably a can of worms.
#2
10/09/2005 (2:21 am)
Hmm any advice on ways to procede via torque script? i've found some more containter searches like boxempty... that might help... I'm a bit too lost sometimes in the C++ code to do much of anything usefull... so i'm not really wanting to delve in there unless i gotta.
#3
10/09/2005 (4:52 am)
Isn't this what a bin search would do?
#4
10/09/2005 (8:09 am)
I could use the equivalent of an area cast for my vehicle code. I have built a modified hover (really modified) that uses the 4 point suspension from the wheeled vehicle class to get the thing to match the terrain. One problem I have is each point is a pin prick into the terrain. So I have been thinking of performing a center cast with 3 or more casts around that point to get good coverage of the terrain. However these would all be straight down rather than fan out.