C# Class Ensage.Common.Extensions.SharpDX.Vector3Extensions

SharpDX/Vector3 Extensions
显示文件 Open project: EnsageSharp/Ensage.Common

Public Methods

Method Description
AngleBetween ( this vector3, System.Vector2 toVector2 ) : float

Returns the angle between two vectors.

AngleBetween ( this vector3, System.Vector3 toVector3 ) : float

Returns the angle between two vectors.

AngleBetween ( this vector3, System.Vector4 toVector4 ) : float

Returns the angle between two vectors.

Closest ( this vector3, IEnumerable array ) : System.Vector2

Seeks for the closest Vector2 to the extended Vector3.

Closest ( this vector3, IEnumerable array ) : System.Vector3

Seeks for the closest Vector3 to the extended Vector3.

Closest ( this vector3, IEnumerable array ) : System.Vector4

Seeks for the closest Vector4 to the extended Vector3.

Distance ( this vector3, System.Vector2 toVector2 ) : float

Calculates the distance between the extended Vector3 and a Vector3.

Distance ( this vector3, System.Vector3 toVector3 ) : float

Calculates the distance between the extended Vector3 and a Vector3.

Distance ( this vector3, System.Vector4 toVector4 ) : float

Calculates the distance between the extended Vector3 and a Vector4.

DistanceSquared ( this vector3, System.Vector2 toVector2 ) : float

Calculates the squared distance between two vectors.

DistanceSquared ( this vector3, System.Vector3 toVector3 ) : float

Calculates the squared distance between two vectors.

DistanceSquared ( this vector3, System.Vector4 toVector4 ) : float

Calculates the squared distance between two vectors.

Extend ( this vector3, System.Vector2 toVector2, float distance ) : System.Vector3

Extends a Vector3 to a Vector2.

Extend ( this vector3, System.Vector3 toVector3, float distance ) : System.Vector3

Extends a Vector3 to another Vector3.

Extend ( this vector3, System.Vector4 toVector4, float distance ) : System.Vector3

Extends a Vector3 to a Vector4.

GetPathLength ( this path ) : float

Gets the total distance of a list of vectors.

IsOnScreen ( this vector3 ) : bool

Returns if the Vector3 is on the screen.

IsOrthogonal ( System.Vector3 vector3, System.Vector2 toVector2 ) : bool

Returns if the angle is orthogonal.

IsOrthogonal ( System.Vector3 vector3, System.Vector3 toVector3 ) : bool

Returns if the angle is orthogonal.

IsOrthogonal ( System.Vector3 vector3, System.Vector4 toVector4 ) : bool

Returns if the angle is orthogonal.

IsUnderTurret ( this position, bool enemyTurretsOnly ) : bool

Returns whether the given position is under a turret

IsValid ( this vector3 ) : bool

Checks for if the extended Vector3 is valid.

IsWall ( this vector3 ) : bool

Returns if the Vector3 position is a wall.

Magnitude ( this vector3 ) : float

Returns the calculated magnitude of the given Vector3.

Normalized ( this vector3 ) : System.Vector3

Normalizes a Vector3.

PathLength ( this path ) : float

Returns the total distance of a path.

Perpendicular ( this vector3, int offset ) : System.Vector3

Returns the Perpendicular Vector3 to the Extended Vector3.

Polar ( this vector3 ) : float

Returns the polar for vector angle (in Degrees).

ProjectOn ( this point, System.Vector3 segmentStart, System.Vector3 segmentEnd ) : ProjectionInfo

Converts the points to 2D, then returns the projection of the Vector2 on the segment.

Rotated ( this vector3, float angle ) : System.Vector3

Rotates the Vector3 to a set angle.

SetZ ( this v, float value = null ) : System.Vector3

Returns the modified Vector3 with a quick changed Z-axis value.

ToVector2 ( this path ) : List

Transforms an extended Vector3 List into a Vector2 List.

ToVector2 ( this vector3 ) : System.Vector2

Transforms an extended Vector3 into a Vector2.

ToVector4 ( this path ) : List

Transforms an extended Vector3 List into a Vector4 List.

ToVector4 ( this vector3, float w = 1f ) : System.Vector4

Transforms an extended Vector3 into a Vector4.

Method Details

AngleBetween() public static method

Returns the angle between two vectors.
public static AngleBetween ( this vector3, System.Vector2 toVector2 ) : float
vector3 this Extended SharpDX Vector3
toVector2 System.Vector2 SharpDX Vector2
return float

AngleBetween() public static method

Returns the angle between two vectors.
public static AngleBetween ( this vector3, System.Vector3 toVector3 ) : float
vector3 this Extended SharpDX Vector3
toVector3 System.Vector3 SharpDX Vector3
return float

AngleBetween() public static method

Returns the angle between two vectors.
public static AngleBetween ( this vector3, System.Vector4 toVector4 ) : float
vector3 this Extended SharpDX Vector3
toVector4 System.Vector4 SharpDX Vector4
return float

Closest() public static method

Seeks for the closest Vector2 to the extended Vector3.
public static Closest ( this vector3, IEnumerable array ) : System.Vector2
vector3 this Extended SharpDX Vector3
array IEnumerable Vector2 Collection
return System.Vector2

Closest() public static method

Seeks for the closest Vector3 to the extended Vector3.
public static Closest ( this vector3, IEnumerable array ) : System.Vector3
vector3 this Extended SharpDX Vector3
array IEnumerable Vector3 Collection
return System.Vector3

Closest() public static method

Seeks for the closest Vector4 to the extended Vector3.
public static Closest ( this vector3, IEnumerable array ) : System.Vector4
vector3 this Extended SharpDX Vector3
array IEnumerable Vector4 Collection
return System.Vector4

Distance() public static method

Calculates the distance between the extended Vector3 and a Vector3.
public static Distance ( this vector3, System.Vector2 toVector2 ) : float
vector3 this SharpDX Vector3 (From)
toVector2 System.Vector2 SharpDX Vector2 (To)
return float

Distance() public static method

Calculates the distance between the extended Vector3 and a Vector3.
public static Distance ( this vector3, System.Vector3 toVector3 ) : float
vector3 this SharpDX Vector3 (From)
toVector3 System.Vector3 SharpDX Vector3 (To)
return float

Distance() public static method

Calculates the distance between the extended Vector3 and a Vector4.
public static Distance ( this vector3, System.Vector4 toVector4 ) : float
vector3 this SharpDX Vector3 (From)
toVector4 System.Vector4 SharpDX Vector4 (To)
return float

DistanceSquared() public static method

Calculates the squared distance between two vectors.
public static DistanceSquared ( this vector3, System.Vector2 toVector2 ) : float
vector3 this Extended SharpDX Vector3
toVector2 System.Vector2 SharpDX Vector2
return float

DistanceSquared() public static method

Calculates the squared distance between two vectors.
public static DistanceSquared ( this vector3, System.Vector3 toVector3 ) : float
vector3 this Extended SharpDX Vector3
toVector3 System.Vector3 SharpDX Vector3
return float

DistanceSquared() public static method

Calculates the squared distance between two vectors.
public static DistanceSquared ( this vector3, System.Vector4 toVector4 ) : float
vector3 this Extended SharpDX Vector3
toVector4 System.Vector4 SharpDX Vector4
return float

Extend() public static method

Extends a Vector3 to a Vector2.
public static Extend ( this vector3, System.Vector2 toVector2, float distance ) : System.Vector3
vector3 this Extended SharpDX Vector3 (From)
toVector2 System.Vector2 SharpDX Vector2 (To)
distance float Distance (float units)
return System.Vector3

Extend() public static method

Extends a Vector3 to another Vector3.
public static Extend ( this vector3, System.Vector3 toVector3, float distance ) : System.Vector3
vector3 this Extended SharpDX Vector3 (From)
toVector3 System.Vector3 SharpDX Vector3 (To)
distance float Distance (float units)
return System.Vector3

Extend() public static method

Extends a Vector3 to a Vector4.
public static Extend ( this vector3, System.Vector4 toVector4, float distance ) : System.Vector3
vector3 this Extended SharpDX Vector3 (From)
toVector4 System.Vector4 SharpDX Vector4 (To)
distance float Distance (float units)
return System.Vector3

GetPathLength() public static method

Gets the total distance of a list of vectors.
public static GetPathLength ( this path ) : float
path this The path
return float

IsOnScreen() public static method

Returns if the Vector3 is on the screen.
public static IsOnScreen ( this vector3 ) : bool
vector3 this Extended SharpDX Vector3
return bool

IsOrthogonal() public static method

Returns if the angle is orthogonal.
public static IsOrthogonal ( System.Vector3 vector3, System.Vector2 toVector2 ) : bool
vector3 System.Vector3 Extended SharpDX Vector3
toVector2 System.Vector2 SharpDX Vector2
return bool

IsOrthogonal() public static method

Returns if the angle is orthogonal.
public static IsOrthogonal ( System.Vector3 vector3, System.Vector3 toVector3 ) : bool
vector3 System.Vector3 Extended SharpDX Vector3
toVector3 System.Vector3 SharpDX Vector3
return bool

IsOrthogonal() public static method

Returns if the angle is orthogonal.
public static IsOrthogonal ( System.Vector3 vector3, System.Vector4 toVector4 ) : bool
vector3 System.Vector3 Extended SharpDX Vector3
toVector4 System.Vector4 SharpDX Vector2
return bool

IsUnderTurret() public static method

Returns whether the given position is under a turret
public static IsUnderTurret ( this position, bool enemyTurretsOnly ) : bool
position this Extended SharpDX Vector3
enemyTurretsOnly bool Include Enemy Turret Only
return bool

IsValid() public static method

Checks for if the extended Vector3 is valid.
public static IsValid ( this vector3 ) : bool
vector3 this /// SharpDX Vector3 ///
return bool

IsWall() public static method

Returns if the Vector3 position is a wall.
public static IsWall ( this vector3 ) : bool
vector3 this Extended SharpDX Vector3
return bool

Magnitude() public static method

Returns the calculated magnitude of the given Vector3.
public static Magnitude ( this vector3 ) : float
vector3 this Extended SharpDX Vector3
return float

Normalized() public static method

Normalizes a Vector3.
public static Normalized ( this vector3 ) : System.Vector3
vector3 this SharpDX Vector3
return System.Vector3

PathLength() public static method

Returns the total distance of a path.
public static PathLength ( this path ) : float
path this /// The path. ///
return float

Perpendicular() public static method

Returns the Perpendicular Vector3 to the Extended Vector3.
public static Perpendicular ( this vector3, int offset ) : System.Vector3
vector3 this Extended SharpDX Vector3
offset int Axis Offset (0 = X, 1 = Y)
return System.Vector3

Polar() public static method

Returns the polar for vector angle (in Degrees).
public static Polar ( this vector3 ) : float
vector3 this Extended SharpDX Vector2
return float

ProjectOn() public static method

Converts the points to 2D, then returns the projection of the Vector2 on the segment.
public static ProjectOn ( this point, System.Vector3 segmentStart, System.Vector3 segmentEnd ) : ProjectionInfo
point this The point
segmentStart System.Vector3 Start of Segment
segmentEnd System.Vector3 End of Segment
return ProjectionInfo

Rotated() public static method

Rotates the Vector3 to a set angle.
public static Rotated ( this vector3, float angle ) : System.Vector3
vector3 this Extended SharpDX Vector2
angle float Angle (in radians)
return System.Vector3

SetZ() public static method

Returns the modified Vector3 with a quick changed Z-axis value.
public static SetZ ( this v, float value = null ) : System.Vector3
v this Extended SharpDX Vector3
value float Switched Z value in float-units
return System.Vector3

ToVector2() public static method

Transforms an extended Vector3 List into a Vector2 List.
public static ToVector2 ( this path ) : List
path this /// The path. ///
return List

ToVector2() public static method

Transforms an extended Vector3 into a Vector2.
public static ToVector2 ( this vector3 ) : System.Vector2
vector3 this SharpDX Vector3
return System.Vector2

ToVector4() public static method

Transforms an extended Vector3 List into a Vector4 List.
public static ToVector4 ( this path ) : List
path this /// The path. ///
return List

ToVector4() public static method

Transforms an extended Vector3 into a Vector4.
public static ToVector4 ( this vector3, float w = 1f ) : System.Vector4
vector3 this SharpDX Vector3
w float Float W-axis (default = 0f)
return System.Vector4