Page 1 of 1

[RESOLVED] BoundingBox & Player.Position

Posted: October 15th, 2011, 11:14 am
by BinaryX

Code: Select all

  Position pos = player.Position;
                return this.container.Contains(pos.GetFixed()) || this.container.Contains(pos) || this.container.Contains(pos.ToVector3I());
This piece of code always returns false, its used for my new portal system.
container contains 2 position, 1 from the bottom left corner, 1 from the top right corner.
When i stand inside the boundingbox ingame nothing happens, no log message or anything, tried to debug it already.

Re: BoundingBox & Player.Position

Posted: October 15th, 2011, 4:18 pm
by fragmer
Player coordinates are 32 units per block. All building, map, and zone-related coordinates are 1 unit per block. Make sure you do the conversion before testing bounds.

Re: BoundingBox & Player.Position

Posted: October 15th, 2011, 11:02 pm
by BinaryX
So divide by 32?

Re: BoundingBox & Player.Position

Posted: October 16th, 2011, 3:12 am
by fragmer
Divide by 32, and do proper rounding.