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;
// 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) {
}

View File

@ -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
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

View File

@ -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) {
}

View File

@ -38,7 +38,7 @@ class EdgeEdgeContact : public Contact {
Segment3D contactSegment; // Contact segment
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
Segment3D getContactSegment() const; // Return the contact segment

View File

@ -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) {
}

View File

@ -39,7 +39,7 @@ class EdgeVertexContact : public Contact {
Vector3D contactVertex; // Contact vertex
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
Vector3D getContactVertex() const; // Return the contact vertex

View File

@ -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) {
}

View File

@ -38,7 +38,7 @@ class FaceEdgeContact : public Contact {
Segment3D contactSegment;
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
Segment3D getContactSegment() const; // Return the contact segment

View File

@ -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) {
}

View File

@ -38,7 +38,7 @@ class FaceFaceContact : public Contact {
Polygon3D contactPolygon;
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
Polygon3D getContactPolygon() const; // Return the contact polygon

View File

@ -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) {
}

View File

@ -38,7 +38,7 @@ class FaceVertexContact : public Contact {
Vector3D contactVertex; // Contact vertex
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
Vector3D getContactVertex() const; // Return the contact vertex

View File

@ -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) {
}

View File

@ -38,7 +38,7 @@ class VertexVertexContact : public Contact {
Vector3D contactVertex; // Contact vertex
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
Vector3D getContactVertex() const; // Return the contact vertex