Skip to content

Commit

Permalink
Refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
notgiven688 committed Nov 24, 2024
1 parent 0623eaf commit fc4dde8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Jitter2/LinearMath/JMatrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ public static JMatrix CreateRotationX(Real radians)
{
JMatrix result = Identity;

Real c = (Real)Math.Cos(radians);
Real s = (Real)Math.Sin(radians);
Real c = MathR.Cos(radians);
Real s = MathR.Sin(radians);

// [ 1 0 0 ]
// [ 0 c -s ]
Expand All @@ -209,8 +209,8 @@ public static JMatrix CreateRotationY(Real radians)
{
JMatrix result = Identity;

Real c = (Real)Math.Cos(radians);
Real s = (Real)Math.Sin(radians);
Real c = MathR.Cos(radians);
Real s = MathR.Sin(radians);

// [ c 0 s ]
// [ 0 1 0 ]
Expand All @@ -227,8 +227,8 @@ public static JMatrix CreateRotationZ(Real radians)
{
JMatrix result = Identity;

Real c = (Real)Math.Cos(radians);
Real s = (Real)Math.Sin(radians);
Real c = MathR.Cos(radians);
Real s = MathR.Sin(radians);

// [ c -s 0 ]
// [ s c 0 ]
Expand Down
4 changes: 2 additions & 2 deletions src/Jitter2/World.Step.cs
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,10 @@ private void IntegrateCallback(Parallel.Batch batch)
else
{
// sync(fAngle) = sin(c*fAngle)/t
JVector.Multiply(avel, (Real)Math.Sin((Real)0.5 * angle * substep_dt) / angle, out axis);
JVector.Multiply(avel, MathR.Sin((Real)0.5 * angle * substep_dt) / angle, out axis);
}

JQuaternion dorn = new(axis.X, axis.Y, axis.Z, (Real)Math.Cos(angle * substep_dt * (Real)0.5));
JQuaternion dorn = new(axis.X, axis.Y, axis.Z, MathR.Cos(angle * substep_dt * (Real)0.5));
//JQuaternion.CreateFromMatrix(rigidBody.Orientation, out JQuaternion ornA);
JQuaternion ornA = rigidBody.Orientation;

Expand Down

0 comments on commit fc4dde8

Please sign in to comment.