Fix merge conflicts

This commit is contained in:
Daniel Chappuis 2021-04-01 23:06:29 +02:00
commit e4f7a8da26
2 changed files with 7 additions and 8 deletions

View File

@ -103,7 +103,7 @@ void RigidBodyComponents::allocate(uint32 nbComponentsToAllocate) {
memcpy(newBodies, mRigidBodies, mNbComponents * sizeof(RigidBody*)); memcpy(newBodies, mRigidBodies, mNbComponents * sizeof(RigidBody*));
memcpy(newIsAllowedToSleep, mIsAllowedToSleep, mNbComponents * sizeof(bool)); memcpy(newIsAllowedToSleep, mIsAllowedToSleep, mNbComponents * sizeof(bool));
memcpy(newIsSleeping, mIsSleeping, mNbComponents * sizeof(bool)); memcpy(newIsSleeping, mIsSleeping, mNbComponents * sizeof(bool));
memcpy(newSleepTimes, mSleepTimes, mNbComponents * sizeof(bool)); memcpy(newSleepTimes, mSleepTimes, mNbComponents * sizeof(decimal));
memcpy(newBodyTypes, mBodyTypes, mNbComponents * sizeof(BodyType)); memcpy(newBodyTypes, mBodyTypes, mNbComponents * sizeof(BodyType));
memcpy(newLinearVelocities, mLinearVelocities, mNbComponents * sizeof(Vector3)); memcpy(newLinearVelocities, mLinearVelocities, mNbComponents * sizeof(Vector3));
memcpy(newAngularVelocities, mAngularVelocities, mNbComponents * sizeof(Vector3)); memcpy(newAngularVelocities, mAngularVelocities, mNbComponents * sizeof(Vector3));

View File

@ -521,8 +521,9 @@ void ContactSolverSystem::solve() {
// Compute the bias "b" of the constraint // Compute the bias "b" of the constraint
decimal biasPenetrationDepth = 0.0; decimal biasPenetrationDepth = 0.0;
if (mContactPoints[contactPointIndex].penetrationDepth > SLOP) biasPenetrationDepth = -(beta/mTimeStep) * if (mContactPoints[contactPointIndex].penetrationDepth > SLOP) {
std::max(0.0f, float(mContactPoints[contactPointIndex].penetrationDepth - SLOP)); biasPenetrationDepth = -(beta/mTimeStep) * std::max(0.0f, float(mContactPoints[contactPointIndex].penetrationDepth - SLOP));
}
decimal b = biasPenetrationDepth + mContactPoints[contactPointIndex].restitutionBias; decimal b = biasPenetrationDepth + mContactPoints[contactPointIndex].restitutionBias;
// Compute the Lagrange multiplier lambda // Compute the Lagrange multiplier lambda
@ -651,7 +652,6 @@ void ContactSolverSystem::solve() {
mContactConstraints[c].r2CrossT1.y * deltaLambda, mContactConstraints[c].r2CrossT1.y * deltaLambda,
mContactConstraints[c].r2CrossT1.z * deltaLambda); mContactConstraints[c].r2CrossT1.z * deltaLambda);
// Update the velocities of the body 1 by applying the impulse P // Update the velocities of the body 1 by applying the impulse P
mRigidBodyComponents.mConstrainedLinearVelocities[rigidBody1Index].x -= mContactConstraints[c].massInverseBody1 * linearImpulseBody2.x * mContactConstraints[c].linearLockAxisFactorBody1.x; mRigidBodyComponents.mConstrainedLinearVelocities[rigidBody1Index].x -= mContactConstraints[c].massInverseBody1 * linearImpulseBody2.x * mContactConstraints[c].linearLockAxisFactorBody1.x;
mRigidBodyComponents.mConstrainedLinearVelocities[rigidBody1Index].y -= mContactConstraints[c].massInverseBody1 * linearImpulseBody2.y * mContactConstraints[c].linearLockAxisFactorBody1.y; mRigidBodyComponents.mConstrainedLinearVelocities[rigidBody1Index].y -= mContactConstraints[c].massInverseBody1 * linearImpulseBody2.y * mContactConstraints[c].linearLockAxisFactorBody1.y;
@ -796,10 +796,9 @@ void ContactSolverSystem::computeFrictionVectors(const Vector3& deltaVelocity, C
assert(contact.normal.length() > decimal(0.0)); assert(contact.normal.length() > decimal(0.0));
// Compute the velocity difference vector in the tangential plane // Compute the velocity difference vector in the tangential plane
const Vector3 normalVelocity(deltaVelocity.x * contact.normal.x * contact.normal.x, decimal deltaVDotNormal = deltaVelocity.dot(contact.normal);
deltaVelocity.y * contact.normal.y * contact.normal.y, Vector3 normalVelocity = deltaVDotNormal * contact.normal;
deltaVelocity.z * contact.normal.z * contact.normal.z); Vector3 tangentVelocity(deltaVelocity.x - normalVelocity.x, deltaVelocity.y - normalVelocity.y,
const Vector3 tangentVelocity(deltaVelocity.x - normalVelocity.x, deltaVelocity.y - normalVelocity.y,
deltaVelocity.z - normalVelocity.z); deltaVelocity.z - normalVelocity.z);
// If the velocty difference in the tangential plane is not zero // If the velocty difference in the tangential plane is not zero