C# 클래스 Ensage.Common.Extensions.VectorExtensions

Extension class for Vector2, Vector3 and Vector4 classes of SharpDX.
파일 보기 프로젝트 열기: EnsageSharp/Ensage.Common 1 사용 예제들

공개 메소드들

메소드 설명
Distance ( this v1, System.Vector2 v2 ) : float

Extension wrapper for Vector2.Distance method

Distance ( this v1, System.Vector3 v2 ) : float

Extension wrapper for Vector3.Distance method

Distance ( this v1, System.Vector4 v2 ) : float

Extension wrapper for Vector4.Distance method

Distance2D ( this vector, System.Entity unit ) : float

Extension wrapper for Vector2.Distance method, to calculate distance between a vector and a unit

Distance2D ( this v1, System.Vector3 v2 ) : float

Extension wrapper for Vector2.Distance method

Distance2D ( this v1, System.Vector4 v2 ) : float

Extension wrapper for Vector2.Distance method

Distance3D ( this v1, System.Vector4 v2 ) : float

Extension wrapper for Vector3.Distance method

FindAngleBetween ( this first, System.Entity unit, bool radian = false ) : float

Calculates the angle between a vector and a unit. The angle represents at which direction the unit resides in compared to vector. Returns degree values on default, radian if requested.

FindAngleBetween ( this first, System.Vector2 second, bool radian = false ) : float

Calculates the angle between two vectors. The angle represents at which direction the second vector resides in compared to first vector. Returns degree values on default, radian if requested.

FromPolarAngle ( float polar ) : System.Vector2

Constructs a Unit Vector2 from polar angle

FromPolarCoordinates ( float radial, float polar ) : System.Vector2

Constructs a Vector2 from polar coordinates.

IsValid ( this v ) : bool

Returns true if the vector is valid.

PolarAngle ( this vector, bool radian = false ) : float

Calculates the polar angle of the given vector. Returns degree values on default, radian if requested.

Rotate ( this vector, float delta ) : System.Vector2

Rotates the given vector by given angle relative to zero vector.

Rotate ( this vector, float delta, System.Vector2 origin ) : System.Vector2

Rotates the given vector by given angle relative to given origin

SwitchYZ ( this v ) : System.Vector3

ToVector2 ( this vector ) : System.Vector2

Converts the given Vector3 to a Vector2. Disregards Z property.

ToVector3 ( this vector ) : System.Vector3

Converts the given Vector4 to a Vector3. Disregards W property.

ToVector3 ( this vector, bool ground = false ) : System.Vector3

Converts the Vector2 to Vector3. Populates the Z property of the returned value with ground data if requested.

ToVector4 ( this vector ) : System.Vector4

Converts the given Vector3 to a Vector4.

ToVector4 ( this vector, bool ground = false ) : System.Vector4

Converts the Vector2 to Vector4. Populates the Z property of the returned value with ground data if requested.

비공개 메소드들

메소드 설명
FindAngleBetween ( this first, System.Vector3 second, bool radian = false ) : float

메소드 상세

Distance() 공개 정적인 메소드

Extension wrapper for Vector2.Distance method
public static Distance ( this v1, System.Vector2 v2 ) : float
v1 this First vector
v2 System.Vector2 Second vector
리턴 float

Distance() 공개 정적인 메소드

Extension wrapper for Vector3.Distance method
public static Distance ( this v1, System.Vector3 v2 ) : float
v1 this First vector
v2 System.Vector3 Second vector
리턴 float

Distance() 공개 정적인 메소드

Extension wrapper for Vector4.Distance method
public static Distance ( this v1, System.Vector4 v2 ) : float
v1 this First vector
v2 System.Vector4 Second vector
리턴 float

Distance2D() 공개 정적인 메소드

Extension wrapper for Vector2.Distance method, to calculate distance between a vector and a unit
public static Distance2D ( this vector, System.Entity unit ) : float
vector this Vector
unit System.Entity Unit
리턴 float

Distance2D() 공개 정적인 메소드

Extension wrapper for Vector2.Distance method
public static Distance2D ( this v1, System.Vector3 v2 ) : float
v1 this First vector
v2 System.Vector3 Second vector
리턴 float

Distance2D() 공개 정적인 메소드

Extension wrapper for Vector2.Distance method
public static Distance2D ( this v1, System.Vector4 v2 ) : float
v1 this First vector
v2 System.Vector4 Second vector
리턴 float

Distance3D() 공개 정적인 메소드

Extension wrapper for Vector3.Distance method
public static Distance3D ( this v1, System.Vector4 v2 ) : float
v1 this First vector
v2 System.Vector4 Second vector
리턴 float

FindAngleBetween() 공개 정적인 메소드

Calculates the angle between a vector and a unit. The angle represents at which direction the unit resides in compared to vector. Returns degree values on default, radian if requested.
public static FindAngleBetween ( this first, System.Entity unit, bool radian = false ) : float
first this
unit System.Entity
radian bool Should the format be radian
리턴 float

FindAngleBetween() 공개 정적인 메소드

Calculates the angle between two vectors. The angle represents at which direction the second vector resides in compared to first vector. Returns degree values on default, radian if requested.
public static FindAngleBetween ( this first, System.Vector2 second, bool radian = false ) : float
first this First Vector
second System.Vector2 Second Vector
radian bool Should the format be radian
리턴 float

FromPolarAngle() 공개 정적인 메소드

Constructs a Unit Vector2 from polar angle
public static FromPolarAngle ( float polar ) : System.Vector2
polar float Polar angle of the vector
리턴 System.Vector2

FromPolarCoordinates() 공개 정적인 메소드

Constructs a Vector2 from polar coordinates.
public static FromPolarCoordinates ( float radial, float polar ) : System.Vector2
radial float Radial of the vector
polar float Polar angle of the vector
리턴 System.Vector2

IsValid() 공개 정적인 메소드

Returns true if the vector is valid.
public static IsValid ( this v ) : bool
v this
리턴 bool

PolarAngle() 공개 정적인 메소드

Calculates the polar angle of the given vector. Returns degree values on default, radian if requested.
public static PolarAngle ( this vector, bool radian = false ) : float
vector this Vector whose polar angle will be returned
radian bool Should the format be radian
리턴 float

Rotate() 공개 정적인 메소드

Rotates the given vector by given angle relative to zero vector.
public static Rotate ( this vector, float delta ) : System.Vector2
vector this Vector to be rotated
delta float Rotation represented in radians
리턴 System.Vector2

Rotate() 공개 정적인 메소드

Rotates the given vector by given angle relative to given origin
public static Rotate ( this vector, float delta, System.Vector2 origin ) : System.Vector2
vector this Vector to be rotated
delta float Rotation represented in radians
origin System.Vector2 Origin vector
리턴 System.Vector2

SwitchYZ() 공개 정적인 메소드

public static SwitchYZ ( this v ) : System.Vector3
v this
리턴 System.Vector3

ToVector2() 공개 정적인 메소드

Converts the given Vector3 to a Vector2. Disregards Z property.
public static ToVector2 ( this vector ) : System.Vector2
vector this Vector to be converted
리턴 System.Vector2

ToVector3() 공개 정적인 메소드

Converts the given Vector4 to a Vector3. Disregards W property.
public static ToVector3 ( this vector ) : System.Vector3
vector this Vector to be converted
리턴 System.Vector3

ToVector3() 공개 정적인 메소드

Converts the Vector2 to Vector3. Populates the Z property of the returned value with ground data if requested.
public static ToVector3 ( this vector, bool ground = false ) : System.Vector3
vector this Source Vector2
ground bool Boolean value representing if the ground position should be found
리턴 System.Vector3

ToVector4() 공개 정적인 메소드

Converts the given Vector3 to a Vector4.
public static ToVector4 ( this vector ) : System.Vector4
vector this Vector to be converted
리턴 System.Vector4

ToVector4() 공개 정적인 메소드

Converts the Vector2 to Vector4. Populates the Z property of the returned value with ground data if requested.
public static ToVector4 ( this vector, bool ground = false ) : System.Vector4
vector this Source Vector2
ground bool Boolean value representing if the ground position should be found
리턴 System.Vector4