C# 클래스 hyades.physics.VectorHelper

파일 보기 프로젝트 열기: zfedoran/bubblebound 1 사용 예제들

공개 메소드들

메소드 설명
IsCCW ( Vector2 a, Vector2 b ) : bool

is rotating from A to B Counter-clockwise?

LineIntersect ( Vector2 ptA, Vector2 ptB, Vector2 ptC, Vector2 ptD, Vector2 &hitPt ) : bool

see if 2 line segments intersect. (line AB collides with line CD) - simplified version

LineIntersect ( Vector2 ptA, Vector2 ptB, Vector2 ptC, Vector2 ptD, Vector2 &hitPt, float &Ua, float &Ub ) : bool

see if 2 line segments intersect. (line AB collides with line CD)

Perpendicular ( Vector2 vector ) : Vector2

get a vector perpendicular to this vector.

Perpendicular ( Vector2 &vector ) : void

make this vector perpendicular to itself

Perpendicular ( Vector2 &vectorIn, Vector2 &vectorOut ) : void

get a vector perpendicular to this vector (reference type version)

Rotate ( Vector2 vector, float radians ) : Vector2

rotate a vector by a given angle (in radians).

Rotate ( Vector2 &vector, float radians ) : void

rotate a given vector by a given angle (reference type version)

Rotate ( Vector2 &vectorIn, float radians, Vector2 &vectorOut ) : void

rotate a vector by a given angle (reference type version)

Vector3FromVector2 ( Vector2 vector ) : Vector3

turn a Vector2 into a Vector3 (sets Z component to zero)

Vector3FromVector2 ( Vector2 vector, float z ) : Vector3

turn a Vector2 into a Vector3, specifying the Z component to use.

메소드 상세

IsCCW() 공개 정적인 메소드

is rotating from A to B Counter-clockwise?
public static IsCCW ( Vector2 a, Vector2 b ) : bool
a Vector2
b Vector2
리턴 bool

LineIntersect() 공개 정적인 메소드

see if 2 line segments intersect. (line AB collides with line CD) - simplified version
public static LineIntersect ( Vector2 ptA, Vector2 ptB, Vector2 ptC, Vector2 ptD, Vector2 &hitPt ) : bool
ptA Vector2 first point on line AB
ptB Vector2 second point on line AB
ptC Vector2 first point on line CD
ptD Vector2 second point on line CD
hitPt Vector2 resulting point of intersection
리턴 bool

LineIntersect() 공개 정적인 메소드

see if 2 line segments intersect. (line AB collides with line CD)
public static LineIntersect ( Vector2 ptA, Vector2 ptB, Vector2 ptC, Vector2 ptD, Vector2 &hitPt, float &Ua, float &Ub ) : bool
ptA Vector2 first point on line AB
ptB Vector2 second point on line AB
ptC Vector2 first point on line CD
ptD Vector2 second point on line CD
hitPt Vector2 resulting point of intersection
Ua float distance along AB to intersection [0,1]
Ub float distance long CD to intersection [0,1]
리턴 bool

Perpendicular() 공개 정적인 메소드

get a vector perpendicular to this vector.
public static Perpendicular ( Vector2 vector ) : Vector2
vector Vector2
리턴 Vector2

Perpendicular() 공개 정적인 메소드

make this vector perpendicular to itself
public static Perpendicular ( Vector2 &vector ) : void
vector Vector2
리턴 void

Perpendicular() 공개 정적인 메소드

get a vector perpendicular to this vector (reference type version)
public static Perpendicular ( Vector2 &vectorIn, Vector2 &vectorOut ) : void
vectorIn Vector2
vectorOut Vector2
리턴 void

Rotate() 공개 정적인 메소드

rotate a vector by a given angle (in radians).
public static Rotate ( Vector2 vector, float radians ) : Vector2
vector Vector2
radians float
리턴 Vector2

Rotate() 공개 정적인 메소드

rotate a given vector by a given angle (reference type version)
public static Rotate ( Vector2 &vector, float radians ) : void
vector Vector2
radians float
리턴 void

Rotate() 공개 정적인 메소드

rotate a vector by a given angle (reference type version)
public static Rotate ( Vector2 &vectorIn, float radians, Vector2 &vectorOut ) : void
vectorIn Vector2
radians float
vectorOut Vector2
리턴 void

Vector3FromVector2() 공개 정적인 메소드

turn a Vector2 into a Vector3 (sets Z component to zero)
public static Vector3FromVector2 ( Vector2 vector ) : Vector3
vector Vector2
리턴 Vector3

Vector3FromVector2() 공개 정적인 메소드

turn a Vector2 into a Vector3, specifying the Z component to use.
public static Vector3FromVector2 ( Vector2 vector, float z ) : Vector3
vector Vector2
z float
리턴 Vector3