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

SharpDX/Vector2 Extensions.
Afficher le fichier Open project: EnsageSharp/Ensage.Common

Méthodes publiques

Méthode Description
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.

Method Details

AngleBetween() public static méthode

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
Résultat float

AngleBetween() public static méthode

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
Résultat float

AngleBetween() public static méthode

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
Résultat float

CircleCircleIntersection() public static méthode

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
Résultat System.Vector2[]

Closest() public static méthode

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
Résultat System.Vector2

Closest() public static méthode

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
Résultat System.Vector3

Closest() public static méthode

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
Résultat System.Vector4

CrossProduct() public static méthode

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. ///
Résultat float

Distance() public static méthode

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)
Résultat float

Distance() public static méthode

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)
Résultat float

Distance() public static méthode

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)
Résultat float

DistanceSquared() public static méthode

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
Résultat float

DistanceSquared() public static méthode

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
Résultat float

DistanceSquared() public static méthode

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
Résultat float

DistanceSquared() public static méthode

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
Résultat float

DistanceToLineSegment() public static méthode

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
Résultat float

Extend() public static méthode

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)
Résultat System.Vector2

Extend() public static méthode

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)
Résultat System.Vector2

Extend() public static méthode

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)
Résultat System.Vector2

GetPathLength() public static méthode

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

Intersection() public static méthode

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)
Résultat IntersectionResult

IsOnScreen() public static méthode

Returns if the Vector2 is on the screen.
public static IsOnScreen ( this vector2 ) : bool
vector2 this Extended SharpDX Vector2
Résultat bool

IsOrthogonal() public static méthode

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
Résultat bool

IsOrthogonal() public static méthode

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
Résultat bool

IsOrthogonal() public static méthode

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
Résultat bool

IsUnderRectangle() public static méthode

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 ///
Résultat bool

IsUnderTurret() public static méthode

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
Résultat bool

IsValid() public static méthode

Checks for if the extended Vector2 is valid.
public static IsValid ( this vector2 ) : bool
vector2 this SharpDX Vector2
Résultat bool

IsWall() public static méthode

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

Magnitude() public static méthode

Returns the calculated magnitude of the given Vector2.
public static Magnitude ( this vector2 ) : float
vector2 this Extended SharpDX Vector2
Résultat float

Normalized() public static méthode

Normalizes a Vector2.
public static Normalized ( this vector2 ) : System.Vector2
vector2 this SharpDX Vector2
Résultat System.Vector2

PathLength() public static méthode

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

Perpendicular() public static méthode

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)
Résultat System.Vector2

Polar() public static méthode

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

ProjectOn() public static méthode

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
Résultat ProjectionInfo

Rotated() public static méthode

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)
Résultat System.Vector2

ToVector3() public static méthode

Transforms an extended Vector2 List into a Vector3 List.
public static ToVector3 ( this path ) : List
path this /// The path. ///
Résultat List

ToVector3() public static méthode

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)
Résultat System.Vector3

ToVector4() public static méthode

Transforms an extended Vector2 List into a Vector4 List.
public static ToVector4 ( this path ) : List
path this /// The path. ///
Résultat List

ToVector4() public static méthode

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)
Résultat System.Vector4

VectorMovementCollision() public static méthode

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. ///
Résultat MovementCollisionInfo

VectorMovementCollision() public static méthode

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. ///
Résultat MovementCollisionInfo