Find a point in a square
Posted: Tue Dec 09, 2008 2:55 pm
The title might look a bit vague but it's basically what I want to do. I don't want to use a script_origin with isTouching nor a trigger. I don't want to spawn entities.
What I want to do is save some coordinates which would form a cuboid or a cube (like a floor in a building; check to see if the player is on that floor). And at a time I want to see if a player is within this cuboid/cube.
My questions are these:
- What method would be best to record this? Save its length, width and depth in an array? Or save 8 coords (each corresponding with 1 corner of this 3D box into an array? Or something easier?
- What calculations would I need to do to seek if a player ( X Y Z ) is within the 3D box according to the way I saved the 3D box?
Thank you in advance!
What I want to do is save some coordinates which would form a cuboid or a cube (like a floor in a building; check to see if the player is on that floor). And at a time I want to see if a player is within this cuboid/cube.
My questions are these:
- What method would be best to record this? Save its length, width and depth in an array? Or save 8 coords (each corresponding with 1 corner of this 3D box into an array? Or something easier?
- What calculations would I need to do to seek if a player ( X Y Z ) is within the 3D box according to the way I saved the 3D box?
Thank you in advance!