C# 클래스 Ensage.Common.Extensions.SharpDX.Vector2Extensions

SharpDX/Vector2 Extensions.
파일 보기 프로젝트 열기: EnsageSharp/Ensage.Common

공개 메소드들

메소드 설명
AngleBetween ( this vector2, System.Vector2 toVector2 ) : float

Returns the angle between two vectors.

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

Returns the angle between two vectors.

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

Returns the angle between two vectors.

CircleCircleIntersection ( this center1, System.Vector2 center2, float radius1, float radius2 ) : System.Vector2[]

Returns the two intersection points between two circles.

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

Seeks for the closest Vector2 to the extended Vector2.

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

Seeks for the closest Vector3 to the extended Vector2.

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

Seeks for the closest Vector4 to the extended Vector2.

CrossProduct ( this self, System.Vector2 other ) : float

Returns the cross product Z value.

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

Calculates the distance between the extended Vector2 and a Vector2.

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

Calculates the distance between the extended Vector2 and a Vector3.

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

Calculates the distance between the extended Vector2 and a Vector4.

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

Calculates the squared distance between two vectors.

DistanceSquared ( this point, System.Vector2 segmentStart, System.Vector2 segmentEnd, bool onlyIfOnSegment = false ) : float

Returns the squared distance to the line segment.

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

Calculates the squared distance between two vectors.

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

Calculates the squared distance between two vectors.

DistanceToLineSegment ( this point, System.Vector2 segmentStart, System.Vector2 segmentEnd, bool onlyIfOnSegment = false ) : float

Returns the distance to the line segment.

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

Extends a Vector2 to another Vector2.

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

Extends a Vector2 to a Vector3.

Extend ( this vector2, System.Vector4 toVector4, float distance ) : System.Vector2

Extends a Vector2 to a Vector4.

GetPathLength ( this path ) : float

Gets the total distance of a list of vectors.

Intersection ( this lineSegment1Start, System.Vector2 lineSegment1End, System.Vector2 lineSegment2Start, System.Vector2 lineSegment2End ) : IntersectionResult

Intersects two line segments.

IsOnScreen ( this vector2 ) : bool

Returns if the Vector2 is on the screen.

IsOrthogonal ( this vector2, System.Vector2 toVector2 ) : bool

Returns if the angle is orthogonal.

IsOrthogonal ( this vector2, System.Vector3 toVector3 ) : bool

Returns if the angle is orthogonal.

IsOrthogonal ( this vector2, System.Vector4 toVector4 ) : bool

Returns if the angle is orthogonal.

IsUnderRectangle ( this point, float x, float y, float width, float height ) : bool

Returns true if the point is under the rectangle

IsUnderTurret ( this position, bool enemyTurretsOnly ) : bool

Returns whether the given position is under a turret

IsValid ( this vector2 ) : bool

Checks for if the extended Vector2 is valid.

IsWall ( this vector2 ) : bool

Returns if the Vector2 position is a wall.

Magnitude ( this vector2 ) : float

Returns the calculated magnitude of the given Vector2.

Normalized ( this vector2 ) : System.Vector2

Normalizes a Vector2.

PathLength ( this path ) : float

Returns the total distance of a path.

Perpendicular ( this vector2, int offset ) : System.Vector2

Returns the Perpendicular Vector2 to the Extended Vector2.

Polar ( this vector2 ) : float

Returns the polar for vector angle (in Degrees).

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

Returns the projection of the Vector2 on the segment.

Rotated ( this vector2, float angle ) : System.Vector2

Rotates the Vector2 to a set angle.

ToVector3 ( this path ) : List

Transforms an extended Vector2 List into a Vector3 List.

ToVector3 ( this vector2, float z = 0f ) : System.Vector3

Transforms an extended Vector2 into a Vector3.

ToVector4 ( this path ) : List

Transforms an extended Vector2 List into a Vector4 List.

ToVector4 ( this vector2, float z = 0f, float w = 1f ) : System.Vector4

Transforms an extended Vector2 into a Vector4.

VectorMovementCollision ( this pointStartA, System.Vector2 pointEndA, float pointVelocityA, System.Vector2 pointB, float pointVelocityB, float delay = 0f ) : MovementCollisionInfo

Calculates movement collision between two vectors points.

VectorMovementCollision ( this pointA, float pointVelocityA, System.Vector2 pointB, float pointVelocityB, float delay = 0f ) : MovementCollisionInfo

Calculates movement collision between two vectors points.

메소드 상세

AngleBetween() 공개 정적인 메소드

Returns the angle between two vectors.
public static AngleBetween ( this vector2, System.Vector2 toVector2 ) : float
vector2 this Extended SharpDX Vector2
toVector2 System.Vector2 SharpDX Vector2
리턴 float

AngleBetween() 공개 정적인 메소드

Returns the angle between two vectors.
public static AngleBetween ( this vector2, System.Vector3 toVector3 ) : float
vector2 this Extended SharpDX Vector2
toVector3 System.Vector3 SharpDX Vector3
리턴 float

AngleBetween() 공개 정적인 메소드

Returns the angle between two vectors.
public static AngleBetween ( this vector2, System.Vector4 toVector4 ) : float
vector2 this Extended SharpDX Vector2
toVector4 System.Vector4 SharpDX Vector4
리턴 float

CircleCircleIntersection() 공개 정적인 메소드

Returns the two intersection points between two circles.
public static CircleCircleIntersection ( this center1, System.Vector2 center2, float radius1, float radius2 ) : System.Vector2[]
center1 this Center of Circle 1
center2 System.Vector2 Center of Circle 2
radius1 float Circle 1 Radius
radius2 float Circle 2 Radius
리턴 System.Vector2[]

Closest() 공개 정적인 메소드

Seeks for the closest Vector2 to the extended Vector2.
public static Closest ( this vector2, IEnumerable array ) : System.Vector2
vector2 this Extended SharpDX Vector2
array IEnumerable Vector2 Collection
리턴 System.Vector2

Closest() 공개 정적인 메소드

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

Closest() 공개 정적인 메소드

Seeks for the closest Vector4 to the extended Vector2.
public static Closest ( this vector2, IEnumerable array ) : System.Vector4
vector2 this Extended SharpDX Vector2
array IEnumerable Vector4 Collection
리턴 System.Vector4

CrossProduct() 공개 정적인 메소드

Returns the cross product Z value.
public static CrossProduct ( this self, System.Vector2 other ) : float
self this /// The self Vector2. ///
other System.Vector2 /// The other Vector2. ///
리턴 float

Distance() 공개 정적인 메소드

Calculates the distance between the extended Vector2 and a Vector2.
public static Distance ( this vector2, System.Vector2 toVector2 ) : float
vector2 this SharpDX Vector2 (From)
toVector2 System.Vector2 SharpDX Vector2 (To)
리턴 float

Distance() 공개 정적인 메소드

Calculates the distance between the extended Vector2 and a Vector3.
public static Distance ( this vector2, System.Vector3 toVector3 ) : float
vector2 this SharpDX Vector2 (From)
toVector3 System.Vector3 SharpDX Vector3 (To)
리턴 float

Distance() 공개 정적인 메소드

Calculates the distance between the extended Vector2 and a Vector4.
public static Distance ( this vector2, System.Vector4 toVector4 ) : float
vector2 this SharpDX Vector2 (From)
toVector4 System.Vector4 SharpDX Vector4 (To)
리턴 float

DistanceSquared() 공개 정적인 메소드

Calculates the squared distance between two vectors.
public static DistanceSquared ( this vector2, System.Vector2 toVector2 ) : float
vector2 this Extended SharpDX Vector2
toVector2 System.Vector2 SharpDX Vector2
리턴 float

DistanceSquared() 공개 정적인 메소드

Returns the squared distance to the line segment.
public static DistanceSquared ( this point, System.Vector2 segmentStart, System.Vector2 segmentEnd, bool onlyIfOnSegment = false ) : float
point this Extended SharpDX Vector2
segmentStart System.Vector2 Vector2 Segment Start
segmentEnd System.Vector2 Vector2 Segment End
onlyIfOnSegment bool Only if Segment
리턴 float

DistanceSquared() 공개 정적인 메소드

Calculates the squared distance between two vectors.
public static DistanceSquared ( this vector2, System.Vector3 toVector3 ) : float
vector2 this Extended SharpDX Vector2
toVector3 System.Vector3 SharpDX Vector3
리턴 float

DistanceSquared() 공개 정적인 메소드

Calculates the squared distance between two vectors.
public static DistanceSquared ( this vector2, System.Vector4 toVector4 ) : float
vector2 this Extended SharpDX Vector2
toVector4 System.Vector4 SharpDX Vector4
리턴 float

DistanceToLineSegment() 공개 정적인 메소드

Returns the distance to the line segment.
public static DistanceToLineSegment ( this point, System.Vector2 segmentStart, System.Vector2 segmentEnd, bool onlyIfOnSegment = false ) : float
point this Extended SharpDX Vector2
segmentStart System.Vector2 Vector2 Segment Start
segmentEnd System.Vector2 Vector2 Segment End
onlyIfOnSegment bool Only if Segment
리턴 float

Extend() 공개 정적인 메소드

Extends a Vector2 to another Vector2.
public static Extend ( this vector2, System.Vector2 toVector2, float distance ) : System.Vector2
vector2 this Extended SharpDX Vector2 (From)
toVector2 System.Vector2 SharpDX Vector2 (To)
distance float Distance (float units)
리턴 System.Vector2

Extend() 공개 정적인 메소드

Extends a Vector2 to a Vector3.
public static Extend ( this vector2, System.Vector3 toVector3, float distance ) : System.Vector2
vector2 this Extended SharpDX Vector2 (From)
toVector3 System.Vector3 SharpDX Vector3 (To)
distance float Distance (float units)
리턴 System.Vector2

Extend() 공개 정적인 메소드

Extends a Vector2 to a Vector4.
public static Extend ( this vector2, System.Vector4 toVector4, float distance ) : System.Vector2
vector2 this Extended SharpDX Vector2 (From)
toVector4 System.Vector4 SharpDX Vector4 (To)
distance float Distance (float units)
리턴 System.Vector2

GetPathLength() 공개 정적인 메소드

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

Intersection() 공개 정적인 메소드

Intersects two line segments.
public static Intersection ( this lineSegment1Start, System.Vector2 lineSegment1End, System.Vector2 lineSegment2Start, System.Vector2 lineSegment2End ) : IntersectionResult
lineSegment1Start this Line Segment 1 (Start)
lineSegment1End System.Vector2 Line Segment 1 (End)
lineSegment2Start System.Vector2 Line Segment 2 (Start)>
lineSegment2End System.Vector2 Line Segment 2 (End)
리턴 IntersectionResult

IsOnScreen() 공개 정적인 메소드

Returns if the Vector2 is on the screen.
public static IsOnScreen ( this vector2 ) : bool
vector2 this Extended SharpDX Vector2
리턴 bool

IsOrthogonal() 공개 정적인 메소드

Returns if the angle is orthogonal.
public static IsOrthogonal ( this vector2, System.Vector2 toVector2 ) : bool
vector2 this Extended SharpDX Vector2
toVector2 System.Vector2 SharpDX Vector2
리턴 bool

IsOrthogonal() 공개 정적인 메소드

Returns if the angle is orthogonal.
public static IsOrthogonal ( this vector2, System.Vector3 toVector3 ) : bool
vector2 this Extended SharpDX Vector2
toVector3 System.Vector3 SharpDX Vector3
리턴 bool

IsOrthogonal() 공개 정적인 메소드

Returns if the angle is orthogonal.
public static IsOrthogonal ( this vector2, System.Vector4 toVector4 ) : bool
vector2 this Extended SharpDX Vector2
toVector4 System.Vector4 SharpDX Vector2
리턴 bool

IsUnderRectangle() 공개 정적인 메소드

Returns true if the point is under the rectangle
public static IsUnderRectangle ( this point, float x, float y, float width, float height ) : bool
point this /// Extended SharpDX Vector2 ///
x float /// Rectangle X-axis ///
y float /// Rectangle Y-axis ///
width float /// Rectangle width ///
height float /// Rectangle height ///
리턴 bool

IsUnderTurret() 공개 정적인 메소드

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

IsValid() 공개 정적인 메소드

Checks for if the extended Vector2 is valid.
public static IsValid ( this vector2 ) : bool
vector2 this SharpDX Vector2
리턴 bool

IsWall() 공개 정적인 메소드

Returns if the Vector2 position is a wall.
public static IsWall ( this vector2 ) : bool
vector2 this Extended SharpDX Vector2
리턴 bool

Magnitude() 공개 정적인 메소드

Returns the calculated magnitude of the given Vector2.
public static Magnitude ( this vector2 ) : float
vector2 this Extended SharpDX Vector2
리턴 float

Normalized() 공개 정적인 메소드

Normalizes a Vector2.
public static Normalized ( this vector2 ) : System.Vector2
vector2 this SharpDX Vector2
리턴 System.Vector2

PathLength() 공개 정적인 메소드

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

Perpendicular() 공개 정적인 메소드

Returns the Perpendicular Vector2 to the Extended Vector2.
public static Perpendicular ( this vector2, int offset ) : System.Vector2
vector2 this Extended SharpDX Vector2
offset int Axis Offset (0 = X, 1 = Y)
리턴 System.Vector2

Polar() 공개 정적인 메소드

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

ProjectOn() 공개 정적인 메소드

Returns the projection of the Vector2 on the segment.
public static ProjectOn ( this point, System.Vector2 segmentStart, System.Vector2 segmentEnd ) : ProjectionInfo
point this The Point
segmentStart System.Vector2 Start of Segment
segmentEnd System.Vector2 End of Segment
리턴 ProjectionInfo

Rotated() 공개 정적인 메소드

Rotates the Vector2 to a set angle.
public static Rotated ( this vector2, float angle ) : System.Vector2
vector2 this Extended SharpDX Vector2
angle float Angle (in radians)
리턴 System.Vector2

ToVector3() 공개 정적인 메소드

Transforms an extended Vector2 List into a Vector3 List.
public static ToVector3 ( this path ) : List
path this /// The path. ///
리턴 List

ToVector3() 공개 정적인 메소드

Transforms an extended Vector2 into a Vector3.
public static ToVector3 ( this vector2, float z = 0f ) : System.Vector3
vector2 this SharpDX Vector2
z float Float Z-axis (default = 0f)
리턴 System.Vector3

ToVector4() 공개 정적인 메소드

Transforms an extended Vector2 List into a Vector4 List.
public static ToVector4 ( this path ) : List
path this /// The path. ///
리턴 List

ToVector4() 공개 정적인 메소드

Transforms an extended Vector2 into a Vector4.
public static ToVector4 ( this vector2, float z = 0f, float w = 1f ) : System.Vector4
vector2 this SharpDX Vector2
z float Float Z-axis (default = 0f)
w float Float W-axis (default = 0f)
리턴 System.Vector4

VectorMovementCollision() 공개 정적인 메소드

Calculates movement collision between two vectors points.
public static VectorMovementCollision ( this pointStartA, System.Vector2 pointEndA, float pointVelocityA, System.Vector2 pointB, float pointVelocityB, float delay = 0f ) : MovementCollisionInfo
pointStartA this /// Point A Start. ///
pointEndA System.Vector2 /// Point A End. ///
pointVelocityA float /// Point A Velocity. ///
pointB System.Vector2 /// Point B. ///
pointVelocityB float /// Point B Velocity. ///
delay float /// Additional Delay. ///
리턴 MovementCollisionInfo

VectorMovementCollision() 공개 정적인 메소드

Calculates movement collision between two vectors points.
public static VectorMovementCollision ( this pointA, float pointVelocityA, System.Vector2 pointB, float pointVelocityB, float delay = 0f ) : MovementCollisionInfo
pointA this /// Point A. ///
pointVelocityA float /// Point A Velocity. ///
pointB System.Vector2 /// Point B. ///
pointVelocityB float /// Point B Velocity. ///
delay float /// Additional Delay. ///
리턴 MovementCollisionInfo