Testing if a position is inside a box / trigger
by Bryce · in Torque Game Engine · 11/15/2009 (1:00 pm) · 4 replies
Hello!
Knowing that this will involve a lot of 3d math, does someone here know how to test if a position is within a certain box? I have a position, and I want to test if it's within a certain trigger. Is there a way to figure out if a position is within its world box? Or better yet, is there some kind of convenient isPositionInsideTrigger() function?
Help is appreciated!
Knowing that this will involve a lot of 3d math, does someone here know how to test if a position is within a certain box? I have a position, and I want to test if it's within a certain trigger. Is there a way to figure out if a position is within its world box? Or better yet, is there some kind of convenient isPositionInsideTrigger() function?
Help is appreciated!
#2
11/15/2009 (1:53 pm)
Not quite. The trigger seems to only be detecting players, not the markers I drop in.
#3
bool isContained(const Point3D& in_rContained) const;
bool isOverlapped(const Box3D& in_rOverlap) const;
bool collideLine(const Point3F& start, const Point3F& end) const;
11/15/2009 (2:07 pm)
Box3F Class should help with bool isContained(const Point3D& in_rContained) const;
bool isOverlapped(const Box3D& in_rOverlap) const;
bool collideLine(const Point3F& start, const Point3F& end) const;
#4
11/15/2009 (2:11 pm)
Thanks Thomas, I'll try making a consoleMethod for isContained()
Associate Steve Acaster
[YorkshireRifles.com]
In otherwise - spawn marker, do container search from object, if marker is inside %win else %fail.
3D math (which I've just baffled myself with on my own stuff) cunningly averted.