How can I check if the player is on or in an interior?
by mm · in Torque Game Engine · 11/05/2003 (1:52 pm) · 4 replies
Hi, I am trying to get my bots to chase the player or other bots into or on top of interiors. How would I approach this? How can I access an interior's bounding area? I am really not sure where to start here. If anybody could point me in this direction I would really appreciate it. :)
Thanks!
Matt
Thanks!
Matt
#2
Thanks allot for the help! I haven't dug into it just yet because I was swamped today. I plan to check it out ASAP. Once again thanks for the help, I really appreciate it. :)
Matt
11/06/2003 (3:01 pm)
Hey Badguy, Thanks allot for the help! I haven't dug into it just yet because I was swamped today. I plan to check it out ASAP. Once again thanks for the help, I really appreciate it. :)
Matt
#3
but after a quick look that is not the correct name(usage?)
of the function.
it is actually:
U32 InteriorInstance::getPointZone(const Point3F& p)
which will return the zone id that the point is in.
as well there is:
bool InteriorInstance::getPointInsideScale(const Point3F & pos, F32 * pScale)
which overall looks pretty confucious.
I guess it is not much to do with it.
anyhow you can easily check the bounds of the interior.
simply :
getObjBox();
getWorldBox();
or even:
getWorldSphere();
11/06/2003 (4:13 pm)
Hey no trouble :)but after a quick look that is not the correct name(usage?)
of the function.
it is actually:
U32 InteriorInstance::getPointZone(const Point3F& p)
which will return the zone id that the point is in.
as well there is:
bool InteriorInstance::getPointInsideScale(const Point3F & pos, F32 * pScale)
which overall looks pretty confucious.
I guess it is not much to do with it.
anyhow you can easily check the bounds of the interior.
simply :
getObjBox();
getWorldBox();
or even:
getWorldSphere();
#4
Thanks for your help again, it really helped me out! Now what I am working on is like you said getting them to move around once they are inside. I stumbled over David's thread here and think it might be able to help.
www.garagegames.com/mg/forums/result.thread.php?qt=8126
Matt :)
11/07/2003 (8:43 am)
Hey Badguy, Thanks for your help again, it really helped me out! Now what I am working on is like you said getting them to move around once they are inside. I stumbled over David's thread here and think it might be able to help.
www.garagegames.com/mg/forums/result.thread.php?qt=8126
Matt :)
Torque Owner Badguy
by checking the InteriorInstance class
you will find some methods there for such a feat.
I believe it is called IsPointInside or something.
im not sure how you want to handle the bot moving around in the interior tho...
that is a whole new ballgame.