Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ae05c6f

Browse files
committed
add matrix flip/reflect behavior on X
1 parent f009948 commit ae05c6f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎Assets/Scripts/HolisticMath.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@ static public Coords Shear(Coords position, Vector3 shear)
156156
return mQ.AsCoords();
157157
}
158158

159+
static public Coords ReflectX(Coords position)
160+
{
161+
Matrix mQ;
162+
Matrix mR = new Matrix(4, 4, new float[16] { -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 });
163+
Matrix mP = new Matrix(4, 1, position.AsFloats());
164+
165+
mQ = mR * mP;
166+
return mQ.AsCoords();
167+
}
168+
159169
static public Coords Cross(Coords vector1, Coords vector2)
160170
{
161171
float xMult = vector1.y * vector2.z - vector1.z * vector2.y;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /