Need an approach on positioning items
by Lateral Punk · in Torque Game Engine · 06/28/2005 (5:09 pm) · 4 replies
Hi,
my game involves picking up a flag, and then dropping it later if the user wishes. the problem i'm having is that i currently drop the flag (which is an Item) just a little bit in front of the player. but what happens is that if i do it against say a wall (which is part of my interior) the flag gets lost forever! I know for sure someone has encountered this problem before (but I can't find it on the forums). Basically I require some kind of algorithm to make sure that the transform that i choose to set on my flag doesn't go inside a wall, on top of it, etc. Anyone got any ideas?
my game involves picking up a flag, and then dropping it later if the user wishes. the problem i'm having is that i currently drop the flag (which is an Item) just a little bit in front of the player. but what happens is that if i do it against say a wall (which is part of my interior) the flag gets lost forever! I know for sure someone has encountered this problem before (but I can't find it on the forums). Basically I require some kind of algorithm to make sure that the transform that i choose to set on my flag doesn't go inside a wall, on top of it, etc. Anyone got any ideas?
#2
Look in player.cs under "Armor::doDismount" for just such an issue.
Thanks.
06/28/2005 (7:47 pm)
Kuni,Look in player.cs under "Armor::doDismount" for just such an issue.
Thanks.
#3
06/29/2005 (9:32 am)
Thanks, i'll look into both approaches!
#4
07/11/2005 (9:03 am)
ContainerCastRAy() was the approach i took. and yeah it works in the general case when you are trying to position/scale items into the world.
Associate Matt Fairfax
PopCap