C# Класс Ensage.Common.Extensions.SharpDX.Vector2Extensions

SharpDX/Vector2 Extensions.
Показать файл Открыть проект

Открытые методы

Метод Описание
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