Some modifications in the collision detection.

git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@374 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
chappuis.daniel 2010-08-18 14:49:29 +00:00
parent 619c70dc48
commit 859d8e409b
5 changed files with 9 additions and 6 deletions

View File

@ -25,9 +25,11 @@
#include "../body/OBB.h"
#include "../body/RigidBody.h"
#include <cassert>
#include <complex>
// We want to use the ReactPhysics3D namespace
using namespace reactphysics3d;
using namespace std;
// Constructor
CollisionDetection::CollisionDetection(PhysicsWorld* world) {

View File

@ -51,6 +51,7 @@ class CollisionDetection {
void computeNarrowPhase(); // Compute the narrow-phase collision detection
void computeAllContacts(); // Compute all the contacts from the collision info list
void computeContact(const ContactInfo* const contactInfo); // Compute a contact (and add it to the physics world) for two colliding bodies
void computeContact2(const ContactInfo* const contactInfo); // Compute a contact (and add it to the physics world) for two colliding bodies
public :
CollisionDetection(PhysicsWorld* physicsWorld); // Constructor

View File

@ -27,6 +27,7 @@
#include <cmath>
#include <cassert>
// We want to use the ReactPhysics3D namespace
using namespace reactphysics3d;
@ -170,7 +171,6 @@ bool SATAlgorithm::computeCollisionTest(const OBB* const obb1, const OBB* const
}
else if (penetrationDepth < minPenetrationDepth) { // Interval 1 and 2 overlap with a smaller penetration depth on this axis
minPenetrationDepth = penetrationDepth; // Update the minimum penetration depth
normal = computeContactNormal(obb1->getAxis(2), boxDistance); // Compute the contact normal with the correct sign
}
// Axis B0

View File

@ -30,7 +30,7 @@ namespace reactphysics3d {
// Constants
const double FRICTION_COEFFICIENT = 0.1; // Friction coefficient
const double PENETRATION_FACTOR = 0.6; // Penetration factor (between 0 and 1) which specify the importance of the
const double PENETRATION_FACTOR = 1.0; // Penetration factor (between 0 and 1) which specify the importance of the
// penetration depth in order to calculate the correct impulse for the contact
/* -------------------------------------------------------------------