Detecting Object within container
by Jeff Trier · in Torque Game Engine · 07/18/2003 (7:45 am) · 1 replies
Hi guys,
I have created a standard RTS view where the player can build objects in the usual RTS manner. Basically the player selects the building he/she wishes to build, then selects a location to construct it and then it will build if there are no obstructions. Sort of...
Currently, I am using a radial container search to detect these obstructions, but I would rather have something more accurate. I was thinking the most accurate method would be to use the %obj.getObjectBox() command, then search within this area for any unwanted intrusions. I can't seem to locate a command that would be suitable.
Can anyone shed some light, insight, or thoughts on how I may best achieve this?
Thanks all!
-Jeff
I have created a standard RTS view where the player can build objects in the usual RTS manner. Basically the player selects the building he/she wishes to build, then selects a location to construct it and then it will build if there are no obstructions. Sort of...
Currently, I am using a radial container search to detect these obstructions, but I would rather have something more accurate. I was thinking the most accurate method would be to use the %obj.getObjectBox() command, then search within this area for any unwanted intrusions. I can't seem to locate a command that would be suitable.
Can anyone shed some light, insight, or thoughts on how I may best achieve this?
Thanks all!
-Jeff
About the author
Originally a Classical/Metal musician, I've always been attracted to anything involving computers, including: Networking, PC Building and Repair, software design and coding. I've been involved with game design and development for over 10 years.
Torque Owner Jeff Trier
Simple Distractions Software
I can use %obj.getObjectBox(), which will give me 6 coordinates. I *think* those coordinates are the centers of each side of the collision box. If that's true, I can use 3 raycasts (for the x, y and z axis)to detect an obsticle. Though if I do that, I can't detect within the corners of the box.
Hmm, not sure if that's the best way...
EDIT: At work atm... Just realized that since getObjectBox gave me 6 numbers, it isn't enough for coordinates for each face as I had previously thought. Anyone know what those numbers represent?
Thanks,
-Jeff