public static DirectionToComponents ( this dir, int &x, int &y ) : void | ||
dir | this | |
x | int | |
y | int | |
리턴 | void |
public static IntVector2 operator +(IntVector2 left, Direction right) { int x, y; DirectionExtensions.DirectionToComponents(right, out x, out y); return(new IntVector2(left.X + x, left.Y + y)); }
public static IntVector3 operator +(IntVector3 left, Direction right) { int x, y, z; DirectionExtensions.DirectionToComponents(right, out x, out y, out z); return(new IntVector3(left.X + x, left.Y + y, left.Z + z)); }
public static IntVector2 ToIntVector2(this Direction dir) { Debug.Assert(dir.IsValid()); int x, y; DirectionExtensions.DirectionToComponents(dir, out x, out y); return(new IntVector2(x, y)); }
public DoubleVector3(Direction dir) { int x, y, z; DirectionExtensions.DirectionToComponents(dir, out x, out y, out z); m_x = x; m_y = y; m_z = z; }
/// <summary> /// Rotate dir in 45 degree steps /// </summary> /// <param name="rotate">Rotation units, in 45 degree steps</param> public static Direction RotateDir(Direction dir, int rotate) { int x, y; DirectionExtensions.DirectionToComponents(dir, out x, out y); IntVector2 v = new IntVector2(x, y); v = v.FastRotate(rotate); return(v.ToDirection()); }