diff --git a/RigidBody.cu b/RigidBody.cu index 04acb903656965d297ea8997f121eef4cc4e5eb7..ef4d9c673993f1274811c579e9956475ebb0f266 100644 --- a/RigidBody.cu +++ b/RigidBody.cu @@ -99,11 +99,11 @@ void RigidBody::integrate(int startFinishAll) { if (startFinishAll == 0 || startFinishAll == 1) { // propogate momenta by half step momentum += 0.5 * timestep * force * impulse_to_momentum; - angularMomentum += 0.5 * timestep * torque * impulse_to_momentum; + angularMomentum += 0.5 * timestep * orientation.transpose()*torque * impulse_to_momentum; } else { // propogate momenta by a full timestep momentum += timestep * force * impulse_to_momentum; - angularMomentum += timestep * torque * impulse_to_momentum; + angularMomentum += timestep * orientation.transpose()*torque * impulse_to_momentum; } DebugM(3, " position before: " << position << "\n" << endi); diff --git a/RigidBodyGrid.cu b/RigidBodyGrid.cu index d3467324368cf60720d0cddd305d5733d6edcda1..5c63cf848e824d83e3288e7996421367edccc7c9 100644 --- a/RigidBodyGrid.cu +++ b/RigidBodyGrid.cu @@ -323,7 +323,7 @@ DEVICE ForceEnergy RigidBodyGrid::interpolateForceDLinearly(const Vector3& l) co } // Mix along y. g3[0][iz] = wy * (g2[0][1] - g2[0][0]) + g2[0][0]; - g3[1][iz] = (g2[1][1] - g2[1][0]) + g2[1][0]; + g3[1][iz] = (g2[1][1] - g2[1][0]); g3[2][iz] = wy * (g2[1][1] - g2[1][0]) + g2[1][0]; } // Mix along z.