Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Box2D.NET/B2RevoluteJoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ internal static void b2WarmStartRevoluteJoint(B2JointSim @base, B2StepContext co
float iA = @base.invIA;
float iB = @base.invIB;

// dummy state for static bodies
B2BodyState dummyState = B2BodyState.Create(b2_identityBodyState);
// Static-body branches only read this shared identity state.
B2BodyState dummyState = b2_identityBodyState;

ref readonly B2RevoluteJoint joint = ref @base.uj.revoluteJoint;
B2BodyState stateA = joint.indexA == B2_NULL_INDEX ? dummyState : context.states[joint.indexA];
Expand Down Expand Up @@ -316,8 +316,8 @@ internal static void b2SolveRevoluteJoint(B2JointSim @base, B2StepContext contex
float iA = @base.invIA;
float iB = @base.invIB;

// dummy state for static bodies
B2BodyState dummyState = B2BodyState.Create(b2_identityBodyState);
// Static-body branches only read this shared identity state.
B2BodyState dummyState = b2_identityBodyState;

ref B2RevoluteJoint joint = ref @base.uj.revoluteJoint;

Expand Down
8 changes: 4 additions & 4 deletions src/Box2D.NET/B2WheelJoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ internal static void b2WarmStartWheelJoint(B2JointSim @base, B2StepContext conte
float iA = @base.invIA;
float iB = @base.invIB;

// dummy state for static bodies
B2BodyState dummyState = B2BodyState.Create(b2_identityBodyState);
// Static-body branches only read this shared identity state.
B2BodyState dummyState = b2_identityBodyState;

ref readonly B2WheelJoint joint = ref @base.uj.wheelJoint;

Expand Down Expand Up @@ -326,8 +326,8 @@ internal static void b2SolveWheelJoint(B2JointSim @base, B2StepContext context,
float iA = @base.invIA;
float iB = @base.invIB;

// dummy state for static bodies
B2BodyState dummyState = B2BodyState.Create(b2_identityBodyState);
// Static-body branches only read this shared identity state.
B2BodyState dummyState = b2_identityBodyState;

ref B2WheelJoint joint = ref @base.uj.wheelJoint;

Expand Down