git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@193 92aac97c-a6ce-11dd-a772-7fcde58d38e6

This commit is contained in:
chappuis.daniel 2009-08-06 12:10:20 +00:00
parent 2ba5ffc9c5
commit 0a2a2a6c72
14 changed files with 35 additions and 28 deletions

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
Contact::Contact(Body* const body1, Body* const body2, const Vector3D& normalVector) Contact::Contact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time)
:Constraint(body1, body2), normalVector(normalVector) { :Constraint(body1, body2), normalVector(normalVector), time(time) {
} }

View File

@ -39,12 +39,14 @@ namespace reactphysics3d {
class Contact : public Constraint { class Contact : public Constraint {
private : private :
Vector3D normalVector; // Normal vector of the contact Vector3D normalVector; // Normal vector of the contact
Time time; // Time of contact
public : public :
Contact(Body* const body1, Body* const body2, const Vector3D& normalVector); // Constructor Contact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time); // Constructor
virtual ~Contact(); // Destructor virtual ~Contact(); // Destructor
Vector3D getNormalVector() const; // Return the normal vector of the contact 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 normalVector;
} }
// Return the time of contact
inline Time Contact::getTime() const {
return time;
}
} // End of the ReactPhysics3D namespace } // End of the ReactPhysics3D namespace
#endif #endif

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
EdgeEdgeContact::EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Segment3D& contactSegment) EdgeEdgeContact::EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Time& time, const Segment3D& contactSegment)
:Contact(body1, body2, normalVector), contactSegment(contactSegment) { :Contact(body1, body2, normalVector, time), contactSegment(contactSegment) {
} }

View File

@ -38,8 +38,8 @@ class EdgeEdgeContact : public Contact {
Segment3D contactSegment; // Contact segment Segment3D contactSegment; // Contact segment
public : public :
EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Segment3D& contactSegment); // Constructor EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Time& time, const Segment3D& contactSegment); // Constructor
virtual ~EdgeEdgeContact(); // Destructor virtual ~EdgeEdgeContact(); // Destructor
Segment3D getContactSegment() const; // Return the contact segment Segment3D getContactSegment() const; // Return the contact segment
}; };

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
EdgeVertexContact::EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex) EdgeVertexContact::EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex)
:Contact(body1, body2, normalVector), contactVertex(contactVertex) { :Contact(body1, body2, normalVector, time), contactVertex(contactVertex) {
} }

View File

@ -39,8 +39,8 @@ class EdgeVertexContact : public Contact {
Vector3D contactVertex; // Contact vertex Vector3D contactVertex; // Contact vertex
public : public :
EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex); // Constructor
virtual ~EdgeVertexContact(); // Destructor virtual ~EdgeVertexContact(); // Destructor
Vector3D getContactVertex() const; // Return the contact vertex Vector3D getContactVertex() const; // Return the contact vertex
}; };

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
FaceEdgeContact::FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, Segment3D& contactSegment) FaceEdgeContact::FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, Segment3D& contactSegment)
:Contact(body1, body2, normalVector), contactSegment(contactSegment) { :Contact(body1, body2, normalVector, time), contactSegment(contactSegment) {
} }

View File

@ -38,8 +38,8 @@ class FaceEdgeContact : public Contact {
Segment3D contactSegment; Segment3D contactSegment;
public : public :
FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, Segment3D& contactSegment); // Constructor FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, Segment3D& contactSegment); // Constructor
virtual ~FaceEdgeContact(); // Destructor virtual ~FaceEdgeContact(); // Destructor
Segment3D getContactSegment() const; // Return the contact segment Segment3D getContactSegment() const; // Return the contact segment
}; };

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
FaceFaceContact::FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Polygon3D& contactPolygon) FaceFaceContact::FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Polygon3D& contactPolygon)
:Contact(body1, body2, normalVector), contactPolygon(contactPolygon) { :Contact(body1, body2, normalVector, time), contactPolygon(contactPolygon) {
} }

View File

@ -38,8 +38,8 @@ class FaceFaceContact : public Contact {
Polygon3D contactPolygon; Polygon3D contactPolygon;
public : public :
FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Polygon3D& contactPolygon); // Constructor FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Polygon3D& contactPolygon); // Constructor
virtual ~FaceFaceContact(); // Destructor virtual ~FaceFaceContact(); // Destructor
Polygon3D getContactPolygon() const; // Return the contact polygon Polygon3D getContactPolygon() const; // Return the contact polygon

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
FaceVertexContact::FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex) FaceVertexContact::FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex)
:Contact(body1, body2, normalVector), contactVertex(contactVertex) { :Contact(body1, body2, normalVector, time), contactVertex(contactVertex) {
} }

View File

@ -38,8 +38,8 @@ class FaceVertexContact : public Contact {
Vector3D contactVertex; // Contact vertex Vector3D contactVertex; // Contact vertex
public : public :
FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex); // Constructor
virtual ~FaceVertexContact(); // Destructor virtual ~FaceVertexContact(); // Destructor
Vector3D getContactVertex() const; // Return the contact vertex Vector3D getContactVertex() const; // Return the contact vertex
}; };

View File

@ -24,8 +24,8 @@
using namespace reactphysics3d; using namespace reactphysics3d;
// Constructor // Constructor
VertexVertexContact::VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex) VertexVertexContact::VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex)
:Contact(body1, body2, normalVector), contactVertex(contactVertex) { :Contact(body1, body2, normalVector, time), contactVertex(contactVertex) {
} }

View File

@ -38,8 +38,8 @@ class VertexVertexContact : public Contact {
Vector3D contactVertex; // Contact vertex Vector3D contactVertex; // Contact vertex
public : public :
VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Time& time, const Vector3D& contactVertex); // Constructor
virtual ~VertexVertexContact(); // Destructor virtual ~VertexVertexContact(); // Destructor
Vector3D getContactVertex() const; // Return the contact vertex Vector3D getContactVertex() const; // Return the contact vertex