Пример #1
0
        public static EntityPosition Create(TilePos basePosition, EntityPosition other)
        {
            var offset           = basePosition - other.BasePosition;
            var relativePosition = other.RelativePosition - offset.Vec * Tile.RealSize;

            return(new EntityPosition(basePosition, relativePosition));
        }
Пример #2
0
        public static EntityPosition Create(TilePos basePosition, Vector3 relativePosition)
        {
            var offset = (Vector3I)(relativePosition / Tile.RealSize).Floor();

            basePosition      = basePosition.Offset(offset);
            relativePosition -= offset * Tile.RealSize;

            return(new EntityPosition(basePosition, relativePosition));
        }
Пример #3
0
 public bool Equals(TilePos other)
 {
     return(Vec == other.Vec);
 }
Пример #4
0
 private EntityPosition(TilePos basePos, Vector3 relativePos)
 {
     BasePosition     = basePos;
     RelativePosition = relativePos;
 }