C# 클래스 CryEngine.Matrix34

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

Private Properties

프로퍼티 타입 설명
IsOrthonormal int
Scale void
ScaleColumn void

공개 메소드들

메소드 설명
AddTranslation ( Vec3 t ) : Matrix34
Create ( Vec3 s, Quat q, Vec3 t = default(Vec3) ) : Matrix34
CreateFromVectors ( Vec3 vx, Vec3 vy, Vec3 vz, Vec3 pos ) : Matrix34
CreateIdentity ( ) : Matrix34
CreateRotationAA ( Vec3 rot, Vec3 t = default(Vec3) ) : Matrix34
CreateRotationAA ( float rad, Vec3 axis, Vec3 t = default(Vec3) ) : Matrix34
CreateRotationAA ( float c, float s, Vec3 axis, Vec3 t = default(Vec3) ) : Matrix34
CreateRotationX ( float rad, Vec3 t = default(Vec3) ) : Matrix34
CreateRotationXYZ ( Vec3 rad, Vec3 t = default(Vec3) ) : Matrix34
CreateRotationY ( float rad, Vec3 t = default(Vec3) ) : Matrix34
CreateRotationZ ( float rad, Vec3 t = default(Vec3) ) : Matrix34
CreateScale ( Vec3 s, Vec3 t = default(Vec3) ) : Matrix34
CreateSlerp ( Matrix34 m, Matrix34 n, float t ) : Matrix34
CreateTranslationMat ( Vec3 v ) : Matrix34
Determinant ( ) : float

determinant is ambiguous: only the upper-left-submatrix's determinant is calculated

GetHashCode ( ) : int
Invert ( ) : void
InvertFast ( ) : void
IsEquivalent ( Matrix34 m, float e = 0.05f ) : bool
IsOrthonormalRH ( float threshold = 0.001f ) : int
Matrix34 ( Matrix33 m33 ) : System
Matrix34 ( Vec3 s, Quat q, Vec3 t = default(Vec3) ) : System
Matrix34 ( float v00, float v01, float v02, float v03, float v10, float v11, float v12, float v13, float v20, float v21, float v22, float v23 ) : System
OrthonormalizeFast ( ) : void

Remove scale from matrix.

ScaleTranslation ( float s ) : void
Set ( Vec3 s, Quat q, Vec3 t = default(Vec3) ) : void
SetFromVectors ( Vec3 vx, Vec3 vy, Vec3 vz, Vec3 pos ) : void
SetIdentity ( ) : void
SetRotation33 ( Matrix33 m33 ) : void
SetRotationAA ( Vec3 rot, Vec3 t = default(Vec3) ) : void
SetRotationAA ( float rad, Vec3 axis, Vec3 t = default(Vec3) ) : void
SetRotationAA ( float c, float s, Vec3 axis, Vec3 t = default(Vec3) ) : void
SetRotationX ( float rad, Vec3 t = default(Vec3) ) : void
SetRotationXYZ ( Vec3 rad, Vec3 t = default(Vec3) ) : void
SetRotationY ( float rad, Vec3 t = default(Vec3) ) : void
SetRotationZ ( float rad, Vec3 t = default(Vec3) ) : void
SetScale ( Vec3 s, Vec3 t = default(Vec3) ) : void
SetSlerp ( Matrix34 m, Matrix34 n, float t ) : void

Direct-Matrix-Slerp: for the sake of completeness, I have included the following expression for Spherical-Linear-Interpolation without using quaternions. This is much faster then converting both matrices into quaternions in order to do a quaternion slerp and then converting the slerped quaternion back into a matrix. This is a high-precision calculation. Given two orthonormal 3x3 matrices this function calculates the shortest possible interpolation-path between the two rotations. The interpolation curve forms a great arc on the rotation sphere (geodesic). Not only does Slerp follow a great arc it follows the shortest great arc. Furthermore Slerp has constant angular velocity. All in all Slerp is the optimal interpolation curve between two rotations. STABILITY PROBLEM: There are two singularities at angle=0 and angle=PI. At 0 the interpolation-axis is arbitrary, which means any axis will produce the same result because we have no rotation. Thats why I'm using (1,0,0). At PI the rotations point away from each other and the interpolation-axis is unpredictable. In this case I'm also using the axis (1,0,0). If the angle is ~0 or ~PI, then we have to normalize a very small vector and this can cause numerical instability. The quaternion-slerp has exactly the same problems. Ivo

SetTranslation ( Vec3 t ) : void
SetTranslationMat ( Vec3 v ) : void
TransformPoint ( Vec3 p ) : Vec3

transforms a point and add translation vector

TransformVector ( Vec3 p ) : Vec3

transforms a vector. the translation is not beeing considered

operator ( ) : Matrix34

비공개 메소드들

메소드 설명
IsOrthonormal ( float threshold = 0.001f ) : int

check if we have an orthonormal-base (general case, works even with reflection matrices)

Scale ( Vec3 s ) : void

apply scaling to matrix.

ScaleColumn ( Vec3 s ) : void

apply scaling to the columns of the matrix.

메소드 상세

AddTranslation() 공개 메소드

public AddTranslation ( Vec3 t ) : Matrix34
t Vec3
리턴 Matrix34

Create() 공개 정적인 메소드

public static Create ( Vec3 s, Quat q, Vec3 t = default(Vec3) ) : Matrix34
s Vec3
q Quat
t Vec3
리턴 Matrix34

CreateFromVectors() 공개 정적인 메소드

public static CreateFromVectors ( Vec3 vx, Vec3 vy, Vec3 vz, Vec3 pos ) : Matrix34
vx Vec3
vy Vec3
vz Vec3
pos Vec3
리턴 Matrix34

CreateIdentity() 공개 정적인 메소드

public static CreateIdentity ( ) : Matrix34
리턴 Matrix34

CreateRotationAA() 공개 정적인 메소드

public static CreateRotationAA ( Vec3 rot, Vec3 t = default(Vec3) ) : Matrix34
rot Vec3
t Vec3
리턴 Matrix34

CreateRotationAA() 공개 정적인 메소드

public static CreateRotationAA ( float rad, Vec3 axis, Vec3 t = default(Vec3) ) : Matrix34
rad float
axis Vec3
t Vec3
리턴 Matrix34

CreateRotationAA() 공개 정적인 메소드

public static CreateRotationAA ( float c, float s, Vec3 axis, Vec3 t = default(Vec3) ) : Matrix34
c float
s float
axis Vec3
t Vec3
리턴 Matrix34

CreateRotationX() 공개 정적인 메소드

public static CreateRotationX ( float rad, Vec3 t = default(Vec3) ) : Matrix34
rad float
t Vec3
리턴 Matrix34

CreateRotationXYZ() 공개 정적인 메소드

public static CreateRotationXYZ ( Vec3 rad, Vec3 t = default(Vec3) ) : Matrix34
rad Vec3
t Vec3
리턴 Matrix34

CreateRotationY() 공개 정적인 메소드

public static CreateRotationY ( float rad, Vec3 t = default(Vec3) ) : Matrix34
rad float
t Vec3
리턴 Matrix34

CreateRotationZ() 공개 정적인 메소드

public static CreateRotationZ ( float rad, Vec3 t = default(Vec3) ) : Matrix34
rad float
t Vec3
리턴 Matrix34

CreateScale() 공개 정적인 메소드

public static CreateScale ( Vec3 s, Vec3 t = default(Vec3) ) : Matrix34
s Vec3
t Vec3
리턴 Matrix34

CreateSlerp() 공개 정적인 메소드

public static CreateSlerp ( Matrix34 m, Matrix34 n, float t ) : Matrix34
m Matrix34
n Matrix34
t float
리턴 Matrix34

CreateTranslationMat() 공개 정적인 메소드

public static CreateTranslationMat ( Vec3 v ) : Matrix34
v Vec3
리턴 Matrix34

Determinant() 공개 메소드

determinant is ambiguous: only the upper-left-submatrix's determinant is calculated
public Determinant ( ) : float
리턴 float

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int

Invert() 공개 메소드

public Invert ( ) : void
리턴 void

InvertFast() 공개 메소드

public InvertFast ( ) : void
리턴 void

IsEquivalent() 공개 메소드

public IsEquivalent ( Matrix34 m, float e = 0.05f ) : bool
m Matrix34
e float
리턴 bool

IsOrthonormalRH() 공개 메소드

public IsOrthonormalRH ( float threshold = 0.001f ) : int
threshold float
리턴 int

Matrix34() 공개 메소드

public Matrix34 ( Matrix33 m33 ) : System
m33 Matrix33
리턴 System

Matrix34() 공개 메소드

public Matrix34 ( Vec3 s, Quat q, Vec3 t = default(Vec3) ) : System
s Vec3
q Quat
t Vec3
리턴 System

Matrix34() 공개 메소드

public Matrix34 ( float v00, float v01, float v02, float v03, float v10, float v11, float v12, float v13, float v20, float v21, float v22, float v23 ) : System
v00 float
v01 float
v02 float
v03 float
v10 float
v11 float
v12 float
v13 float
v20 float
v21 float
v22 float
v23 float
리턴 System

OrthonormalizeFast() 공개 메소드

Remove scale from matrix.
public OrthonormalizeFast ( ) : void
리턴 void

ScaleTranslation() 공개 메소드

public ScaleTranslation ( float s ) : void
s float
리턴 void

Set() 공개 메소드

public Set ( Vec3 s, Quat q, Vec3 t = default(Vec3) ) : void
s Vec3
q Quat
t Vec3
리턴 void

SetFromVectors() 공개 메소드

public SetFromVectors ( Vec3 vx, Vec3 vy, Vec3 vz, Vec3 pos ) : void
vx Vec3
vy Vec3
vz Vec3
pos Vec3
리턴 void

SetIdentity() 공개 메소드

public SetIdentity ( ) : void
리턴 void

SetRotation33() 공개 메소드

public SetRotation33 ( Matrix33 m33 ) : void
m33 Matrix33
리턴 void

SetRotationAA() 공개 메소드

public SetRotationAA ( Vec3 rot, Vec3 t = default(Vec3) ) : void
rot Vec3
t Vec3
리턴 void

SetRotationAA() 공개 메소드

public SetRotationAA ( float rad, Vec3 axis, Vec3 t = default(Vec3) ) : void
rad float
axis Vec3
t Vec3
리턴 void

SetRotationAA() 공개 메소드

public SetRotationAA ( float c, float s, Vec3 axis, Vec3 t = default(Vec3) ) : void
c float
s float
axis Vec3
t Vec3
리턴 void

SetRotationX() 공개 메소드

public SetRotationX ( float rad, Vec3 t = default(Vec3) ) : void
rad float
t Vec3
리턴 void

SetRotationXYZ() 공개 메소드

public SetRotationXYZ ( Vec3 rad, Vec3 t = default(Vec3) ) : void
rad Vec3
t Vec3
리턴 void

SetRotationY() 공개 메소드

public SetRotationY ( float rad, Vec3 t = default(Vec3) ) : void
rad float
t Vec3
리턴 void

SetRotationZ() 공개 메소드

public SetRotationZ ( float rad, Vec3 t = default(Vec3) ) : void
rad float
t Vec3
리턴 void

SetScale() 공개 메소드

public SetScale ( Vec3 s, Vec3 t = default(Vec3) ) : void
s Vec3
t Vec3
리턴 void

SetSlerp() 공개 메소드

Direct-Matrix-Slerp: for the sake of completeness, I have included the following expression for Spherical-Linear-Interpolation without using quaternions. This is much faster then converting both matrices into quaternions in order to do a quaternion slerp and then converting the slerped quaternion back into a matrix. This is a high-precision calculation. Given two orthonormal 3x3 matrices this function calculates the shortest possible interpolation-path between the two rotations. The interpolation curve forms a great arc on the rotation sphere (geodesic). Not only does Slerp follow a great arc it follows the shortest great arc. Furthermore Slerp has constant angular velocity. All in all Slerp is the optimal interpolation curve between two rotations. STABILITY PROBLEM: There are two singularities at angle=0 and angle=PI. At 0 the interpolation-axis is arbitrary, which means any axis will produce the same result because we have no rotation. Thats why I'm using (1,0,0). At PI the rotations point away from each other and the interpolation-axis is unpredictable. In this case I'm also using the axis (1,0,0). If the angle is ~0 or ~PI, then we have to normalize a very small vector and this can cause numerical instability. The quaternion-slerp has exactly the same problems. Ivo
public SetSlerp ( Matrix34 m, Matrix34 n, float t ) : void
m Matrix34
n Matrix34
t float
리턴 void

SetTranslation() 공개 메소드

public SetTranslation ( Vec3 t ) : void
t Vec3
리턴 void

SetTranslationMat() 공개 메소드

public SetTranslationMat ( Vec3 v ) : void
v Vec3
리턴 void

TransformPoint() 공개 메소드

transforms a point and add translation vector
public TransformPoint ( Vec3 p ) : Vec3
p Vec3
리턴 Vec3

TransformVector() 공개 메소드

transforms a vector. the translation is not beeing considered
public TransformVector ( Vec3 p ) : Vec3
p Vec3
리턴 Vec3

operator() 공개 정적인 메소드

public static operator ( ) : Matrix34
리턴 Matrix34