From 0a2a2a6c7250dd5bdef1dc0af52757a6cd0fa9c7 Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Thu, 6 Aug 2009 12:10:20 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@193 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- sources/reactphysics3d/constraint/Contact.cpp | 4 ++-- sources/reactphysics3d/constraint/Contact.h | 11 +++++++++-- sources/reactphysics3d/constraint/EdgeEdgeContact.cpp | 4 ++-- sources/reactphysics3d/constraint/EdgeEdgeContact.h | 4 ++-- .../reactphysics3d/constraint/EdgeVertexContact.cpp | 4 ++-- sources/reactphysics3d/constraint/EdgeVertexContact.h | 4 ++-- sources/reactphysics3d/constraint/FaceEdgeContact.cpp | 4 ++-- sources/reactphysics3d/constraint/FaceEdgeContact.h | 4 ++-- sources/reactphysics3d/constraint/FaceFaceContact.cpp | 4 ++-- sources/reactphysics3d/constraint/FaceFaceContact.h | 4 ++-- .../reactphysics3d/constraint/FaceVertexContact.cpp | 4 ++-- sources/reactphysics3d/constraint/FaceVertexContact.h | 4 ++-- .../reactphysics3d/constraint/VertexVertexContact.cpp | 4 ++-- .../reactphysics3d/constraint/VertexVertexContact.h | 4 ++-- 14 files changed, 35 insertions(+), 28 deletions(-) diff --git a/sources/reactphysics3d/constraint/Contact.cpp b/sources/reactphysics3d/constraint/Contact.cpp index 0c082dcb..0b9a24ac 100644 --- a/sources/reactphysics3d/constraint/Contact.cpp +++ b/sources/reactphysics3d/constraint/Contact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -Contact::Contact(Body* const body1, Body* const body2, const Vector3D& normalVector) - :Constraint(body1, body2), normalVector(normalVector) { +Contact::Contact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time) + :Constraint(body1, body2), normalVector(normalVector), time(time) { } diff --git a/sources/reactphysics3d/constraint/Contact.h b/sources/reactphysics3d/constraint/Contact.h index 177c9e16..aec85cff 100644 --- a/sources/reactphysics3d/constraint/Contact.h +++ b/sources/reactphysics3d/constraint/Contact.h @@ -39,12 +39,14 @@ namespace reactphysics3d { class Contact : public Constraint { private : Vector3D normalVector; // Normal vector of the contact + Time time; // Time of contact public : - Contact(Body* const body1, Body* const body2, const Vector3D& normalVector); // Constructor - virtual ~Contact(); // Destructor + Contact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time); // Constructor + virtual ~Contact(); // Destructor Vector3D getNormalVector() const; // Return the normal vector of the contact + Time getTime() const; // Return the time of contact }; @@ -53,6 +55,11 @@ inline Vector3D Contact::getNormalVector() const { return normalVector; } +// Return the time of contact +inline Time Contact::getTime() const { + return time; +} + } // End of the ReactPhysics3D namespace #endif diff --git a/sources/reactphysics3d/constraint/EdgeEdgeContact.cpp b/sources/reactphysics3d/constraint/EdgeEdgeContact.cpp index fff36166..8fdbb721 100644 --- a/sources/reactphysics3d/constraint/EdgeEdgeContact.cpp +++ b/sources/reactphysics3d/constraint/EdgeEdgeContact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -EdgeEdgeContact::EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Segment3D& contactSegment) - :Contact(body1, body2, normalVector), contactSegment(contactSegment) { +EdgeEdgeContact::EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Time& time, const Segment3D& contactSegment) + :Contact(body1, body2, normalVector, time), contactSegment(contactSegment) { } diff --git a/sources/reactphysics3d/constraint/EdgeEdgeContact.h b/sources/reactphysics3d/constraint/EdgeEdgeContact.h index c1a8b3c7..b735d6b8 100644 --- a/sources/reactphysics3d/constraint/EdgeEdgeContact.h +++ b/sources/reactphysics3d/constraint/EdgeEdgeContact.h @@ -38,8 +38,8 @@ class EdgeEdgeContact : public Contact { Segment3D contactSegment; // Contact segment public : - EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Segment3D& contactSegment); // Constructor - virtual ~EdgeEdgeContact(); // Destructor + EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Time& time, const Segment3D& contactSegment); // Constructor + virtual ~EdgeEdgeContact(); // Destructor Segment3D getContactSegment() const; // Return the contact segment }; diff --git a/sources/reactphysics3d/constraint/EdgeVertexContact.cpp b/sources/reactphysics3d/constraint/EdgeVertexContact.cpp index e2ed4b49..f5bd2de9 100644 --- a/sources/reactphysics3d/constraint/EdgeVertexContact.cpp +++ b/sources/reactphysics3d/constraint/EdgeVertexContact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -EdgeVertexContact::EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex) - :Contact(body1, body2, normalVector), contactVertex(contactVertex) { +EdgeVertexContact::EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex) + :Contact(body1, body2, normalVector, time), contactVertex(contactVertex) { } diff --git a/sources/reactphysics3d/constraint/EdgeVertexContact.h b/sources/reactphysics3d/constraint/EdgeVertexContact.h index 0390eeb0..f9132f4f 100644 --- a/sources/reactphysics3d/constraint/EdgeVertexContact.h +++ b/sources/reactphysics3d/constraint/EdgeVertexContact.h @@ -39,8 +39,8 @@ class EdgeVertexContact : public Contact { Vector3D contactVertex; // Contact vertex public : - EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor - virtual ~EdgeVertexContact(); // Destructor + EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex); // Constructor + virtual ~EdgeVertexContact(); // Destructor Vector3D getContactVertex() const; // Return the contact vertex }; diff --git a/sources/reactphysics3d/constraint/FaceEdgeContact.cpp b/sources/reactphysics3d/constraint/FaceEdgeContact.cpp index a3e12267..ae9f67f7 100644 --- a/sources/reactphysics3d/constraint/FaceEdgeContact.cpp +++ b/sources/reactphysics3d/constraint/FaceEdgeContact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -FaceEdgeContact::FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, Segment3D& contactSegment) - :Contact(body1, body2, normalVector), contactSegment(contactSegment) { +FaceEdgeContact::FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, Segment3D& contactSegment) + :Contact(body1, body2, normalVector, time), contactSegment(contactSegment) { } diff --git a/sources/reactphysics3d/constraint/FaceEdgeContact.h b/sources/reactphysics3d/constraint/FaceEdgeContact.h index 0e280369..f258b366 100644 --- a/sources/reactphysics3d/constraint/FaceEdgeContact.h +++ b/sources/reactphysics3d/constraint/FaceEdgeContact.h @@ -38,8 +38,8 @@ class FaceEdgeContact : public Contact { Segment3D contactSegment; public : - FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, Segment3D& contactSegment); // Constructor - virtual ~FaceEdgeContact(); // Destructor + FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, Segment3D& contactSegment); // Constructor + virtual ~FaceEdgeContact(); // Destructor Segment3D getContactSegment() const; // Return the contact segment }; diff --git a/sources/reactphysics3d/constraint/FaceFaceContact.cpp b/sources/reactphysics3d/constraint/FaceFaceContact.cpp index 7d83dcee..4f50f17d 100644 --- a/sources/reactphysics3d/constraint/FaceFaceContact.cpp +++ b/sources/reactphysics3d/constraint/FaceFaceContact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -FaceFaceContact::FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Polygon3D& contactPolygon) - :Contact(body1, body2, normalVector), contactPolygon(contactPolygon) { +FaceFaceContact::FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Polygon3D& contactPolygon) + :Contact(body1, body2, normalVector, time), contactPolygon(contactPolygon) { } diff --git a/sources/reactphysics3d/constraint/FaceFaceContact.h b/sources/reactphysics3d/constraint/FaceFaceContact.h index 8f452b22..d58573ca 100644 --- a/sources/reactphysics3d/constraint/FaceFaceContact.h +++ b/sources/reactphysics3d/constraint/FaceFaceContact.h @@ -38,8 +38,8 @@ class FaceFaceContact : public Contact { Polygon3D contactPolygon; public : - FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Polygon3D& contactPolygon); // Constructor - virtual ~FaceFaceContact(); // Destructor + FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Polygon3D& contactPolygon); // Constructor + virtual ~FaceFaceContact(); // Destructor Polygon3D getContactPolygon() const; // Return the contact polygon diff --git a/sources/reactphysics3d/constraint/FaceVertexContact.cpp b/sources/reactphysics3d/constraint/FaceVertexContact.cpp index ac63df0b..62c54664 100644 --- a/sources/reactphysics3d/constraint/FaceVertexContact.cpp +++ b/sources/reactphysics3d/constraint/FaceVertexContact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -FaceVertexContact::FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex) - :Contact(body1, body2, normalVector), contactVertex(contactVertex) { +FaceVertexContact::FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex) + :Contact(body1, body2, normalVector, time), contactVertex(contactVertex) { } diff --git a/sources/reactphysics3d/constraint/FaceVertexContact.h b/sources/reactphysics3d/constraint/FaceVertexContact.h index 22db1c2d..e94aa225 100644 --- a/sources/reactphysics3d/constraint/FaceVertexContact.h +++ b/sources/reactphysics3d/constraint/FaceVertexContact.h @@ -38,8 +38,8 @@ class FaceVertexContact : public Contact { Vector3D contactVertex; // Contact vertex public : - FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor - virtual ~FaceVertexContact(); // Destructor + FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex); // Constructor + virtual ~FaceVertexContact(); // Destructor Vector3D getContactVertex() const; // Return the contact vertex }; diff --git a/sources/reactphysics3d/constraint/VertexVertexContact.cpp b/sources/reactphysics3d/constraint/VertexVertexContact.cpp index 74d1141b..973b7712 100644 --- a/sources/reactphysics3d/constraint/VertexVertexContact.cpp +++ b/sources/reactphysics3d/constraint/VertexVertexContact.cpp @@ -24,8 +24,8 @@ using namespace reactphysics3d; // Constructor -VertexVertexContact::VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex) - :Contact(body1, body2, normalVector), contactVertex(contactVertex) { +VertexVertexContact::VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex) + :Contact(body1, body2, normalVector, time), contactVertex(contactVertex) { } diff --git a/sources/reactphysics3d/constraint/VertexVertexContact.h b/sources/reactphysics3d/constraint/VertexVertexContact.h index 2bf36144..2ee545ba 100644 --- a/sources/reactphysics3d/constraint/VertexVertexContact.h +++ b/sources/reactphysics3d/constraint/VertexVertexContact.h @@ -38,8 +38,8 @@ class VertexVertexContact : public Contact { Vector3D contactVertex; // Contact vertex public : - VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor - virtual ~VertexVertexContact(); // Destructor + VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex); // Constructor + virtual ~VertexVertexContact(); // Destructor Vector3D getContactVertex() const; // Return the contact vertex