git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@178 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
951725a401
commit
c92a3ade52
sources/reactphysics3d/constraint
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Constraint::Constraint(Body& body1, Body& body2)
|
Constraint::Constraint(Body* const body1, Body* const body2)
|
||||||
:body1(body1), body2(body2) {
|
:body1(body1), body2(body2) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,24 +35,24 @@ namespace reactphysics3d {
|
||||||
*/
|
*/
|
||||||
class Constraint {
|
class Constraint {
|
||||||
private :
|
private :
|
||||||
Body& body1; // Reference to the first body of the constraint
|
Body* const body1; // Pointer to the first body of the constraint
|
||||||
Body& body2; // Reference to the second body of the constraint
|
Body* const body2; // Pointer to the second body of the constraint
|
||||||
|
|
||||||
public :
|
public :
|
||||||
Constraint(Body& body1, Body& body2); // Constructor
|
Constraint(Body* const body1, Body* const body2); // Constructor
|
||||||
virtual ~Constraint(); // Destructor
|
virtual ~Constraint(); // Destructor
|
||||||
|
|
||||||
Body& getBody1() const; // Return the reference to the body 1
|
Body* const getBody1() const; // Return the reference to the body 1
|
||||||
Body& getBody2() const; // Return the reference to the body 2
|
Body* const getBody2() const; // Return the reference to the body 2
|
||||||
};
|
};
|
||||||
|
|
||||||
// Return the reference to the body 1
|
// Return the reference to the body 1
|
||||||
inline Body& Constraint::getBody1() const {
|
inline Body* const Constraint::getBody1() const {
|
||||||
return body1;
|
return body1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the reference to the body 2
|
// Return the reference to the body 2
|
||||||
inline Body& Constraint::getBody2() const {
|
inline Body* const Constraint::getBody2() const {
|
||||||
return body2;
|
return body2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Contact::Contact(Body& body1, Body& body2, const Vector3D& normalVector)
|
Contact::Contact(Body* const body1, Body* const body2, const Vector3D& normalVector)
|
||||||
:Constraint(body1, body2), normalVector(normalVector) {
|
:Constraint(body1, body2), normalVector(normalVector) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Contact : public Constraint {
|
||||||
Vector3D normalVector; // Normal vector of the contact
|
Vector3D normalVector; // Normal vector of the contact
|
||||||
|
|
||||||
public :
|
public :
|
||||||
Contact(Body& body1, Body& body2, const Vector3D& normalVector); // Constructor
|
Contact(Body* const body1, Body* const body2, const Vector3D& normalVector); // 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
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
EdgeEdgeContact::EdgeEdgeContact(Body& body1, Body& body2, const Vector3D normalVector, const Segment3D& contactSegment)
|
EdgeEdgeContact::EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Segment3D& contactSegment)
|
||||||
:Contact(body1, body2, normalVector), contactSegment(contactSegment) {
|
:Contact(body1, body2, normalVector), contactSegment(contactSegment) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class EdgeEdgeContact : public Contact {
|
||||||
Segment3D contactSegment; // Contact segment
|
Segment3D contactSegment; // Contact segment
|
||||||
|
|
||||||
public :
|
public :
|
||||||
EdgeEdgeContact(Body& body1, Body& body2, const Vector3D normalVector, const Segment3D& contactSegment); // Constructor
|
EdgeEdgeContact(Body* const body1, Body* const body2, const Vector3D normalVector, const Segment3D& contactSegment); // Constructor
|
||||||
virtual ~EdgeEdgeContact(); // Destructor
|
virtual ~EdgeEdgeContact(); // Destructor
|
||||||
|
|
||||||
Segment3D getContactSegment() const; // Return the contact segment
|
Segment3D getContactSegment() const; // Return the contact segment
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
EdgeVertexContact::EdgeVertexContact(Body& body1, Body& body2, const Vector3D& normalVector, const Vector3D& contactVertex)
|
EdgeVertexContact::EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex)
|
||||||
:Contact(body1, body2, normalVector), contactVertex(contactVertex) {
|
:Contact(body1, body2, normalVector), contactVertex(contactVertex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class EdgeVertexContact : public Contact {
|
||||||
Vector3D contactVertex; // Contact vertex
|
Vector3D contactVertex; // Contact vertex
|
||||||
|
|
||||||
public :
|
public :
|
||||||
EdgeVertexContact(Body& body1, Body& body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor
|
EdgeVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor
|
||||||
virtual ~EdgeVertexContact(); // Destructor
|
virtual ~EdgeVertexContact(); // Destructor
|
||||||
|
|
||||||
Vector3D getContactVertex() const; // Return the contact vertex
|
Vector3D getContactVertex() const; // Return the contact vertex
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
FaceEdgeContact::FaceEdgeContact(Body& body1, Body& body2, const Vector3D& normalVector, Segment3D& contactSegment)
|
FaceEdgeContact::FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, Segment3D& contactSegment)
|
||||||
:Contact(body1, body2, normalVector), contactSegment(contactSegment) {
|
:Contact(body1, body2, normalVector), contactSegment(contactSegment) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class FaceEdgeContact : public Contact {
|
||||||
Segment3D contactSegment;
|
Segment3D contactSegment;
|
||||||
|
|
||||||
public :
|
public :
|
||||||
FaceEdgeContact(Body& body1, Body& body2, const Vector3D& normalVector, Segment3D& contactSegment); // Constructor
|
FaceEdgeContact(Body* const body1, Body* const body2, const Vector3D& normalVector, Segment3D& contactSegment); // Constructor
|
||||||
virtual ~FaceEdgeContact(); // Destructor
|
virtual ~FaceEdgeContact(); // Destructor
|
||||||
|
|
||||||
Segment3D getContactSegment() const; // Return the contact segment
|
Segment3D getContactSegment() const; // Return the contact segment
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
FaceFaceContact::FaceFaceContact(Body& body1, Body& body2, const Vector3D& normalVector, const Polygon3D& contactPolygon)
|
FaceFaceContact::FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Polygon3D& contactPolygon)
|
||||||
:Contact(body1, body2, normalVector), contactPolygon(contactPolygon) {
|
:Contact(body1, body2, normalVector), contactPolygon(contactPolygon) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class FaceFaceContact : public Contact {
|
||||||
Polygon3D contactPolygon;
|
Polygon3D contactPolygon;
|
||||||
|
|
||||||
public :
|
public :
|
||||||
FaceFaceContact(Body& body1, Body& body2, const Vector3D& normalVector, const Polygon3D& contactPolygon); // Constructor
|
FaceFaceContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Polygon3D& contactPolygon); // Constructor
|
||||||
virtual ~FaceFaceContact(); // Destructor
|
virtual ~FaceFaceContact(); // Destructor
|
||||||
|
|
||||||
Polygon3D getContactPolygon() const; // Return the contact polygon
|
Polygon3D getContactPolygon() const; // Return the contact polygon
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
FaceVertexContact::FaceVertexContact(Body& body1, Body& body2, const Vector3D& normalVector, const Vector3D& contactVertex)
|
FaceVertexContact::FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex)
|
||||||
:Contact(body1, body2, normalVector), contactVertex(contactVertex) {
|
:Contact(body1, body2, normalVector), contactVertex(contactVertex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class FaceVertexContact : public Contact {
|
||||||
Vector3D contactVertex; // Contact vertex
|
Vector3D contactVertex; // Contact vertex
|
||||||
|
|
||||||
public :
|
public :
|
||||||
FaceVertexContact(Body& body1, Body& body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor
|
FaceVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor
|
||||||
virtual ~FaceVertexContact(); // Destructor
|
virtual ~FaceVertexContact(); // Destructor
|
||||||
|
|
||||||
Vector3D getContactVertex() const; // Return the contact vertex
|
Vector3D getContactVertex() const; // Return the contact vertex
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
VertexVertexContact::VertexVertexContact(Body& body1, Body& body2, const Vector3D& normalVector, const Vector3D& contactVertex)
|
VertexVertexContact::VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex)
|
||||||
:Contact(body1, body2, normalVector), contactVertex(contactVertex) {
|
:Contact(body1, body2, normalVector), contactVertex(contactVertex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class VertexVertexContact : public Contact {
|
||||||
Vector3D contactVertex; // Contact vertex
|
Vector3D contactVertex; // Contact vertex
|
||||||
|
|
||||||
public :
|
public :
|
||||||
VertexVertexContact(Body& body1, Body& body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor
|
VertexVertexContact(Body* const body1, Body* const body2, const Vector3D& normalVector, const Vector3D& contactVertex); // Constructor
|
||||||
virtual ~VertexVertexContact(); // Destructor
|
virtual ~VertexVertexContact(); // Destructor
|
||||||
|
|
||||||
Vector3D getContactVertex() const; // Return the contact vertex
|
Vector3D getContactVertex() const; // Return the contact vertex
|
||||||
|
|
Loading…
Reference in New Issue
Block a user