CD_Pair.h
Go to the documentation of this file.
1 #ifndef _CD_PAIR
2 #define _CD_PAIR
3 
4 #pragma once
5 
9 #include <sch/sch_api.h>
10 
11 namespace sch
12 {
13 
14 class CD_Pair
15 {
16 public:
23  SCH_API CD_Pair(S_Object * Obj1, S_Object * Obj2);
24 
25  SCH_API virtual ~CD_Pair(void);
26 
38 
45 
51 
57 
64 
68  SCH_API void setVector(const Vector3 &);
69 
74  SCH_API const Vector3 & getVector() const;
75 
81 
86 
91  SCH_API S_Object * operator[](unsigned char i)
92  {
93  return (i == 0) ? sObj1_ : sObj2_;
94  }
95 
96 protected:
100 
103 
106 
108 
110 
113 
115 
117 
119 
121 
123 
124  void witPoints(Point3 & p1, Point3 & p2);
125 
127 };
128 } // namespace sch
129 
142 #endif
Definition: CD_Depth.h:13
Definition: CD_Pair.h:15
Scalar lambda2_
Definition: CD_Pair.h:111
Point3 p1_
Definition: CD_Pair.h:104
bool collision_
Definition: CD_Pair.h:116
Scalar penetrationDepth()
Scalar precision_
Definition: CD_Pair.h:109
SCH_API void setRelativePrecision(Scalar precision)
sets the relative precision of the proximity queries to a given value. The effective precision is pre...
int lastFeature1_
Definition: CD_Pair.h:99
Scalar GJK()
Vector3 lastDirection_
Definition: CD_Pair.h:98
SCH_API S_Object * operator[](unsigned char i)
returns a pointer to the ith object in the pair
Definition: CD_Pair.h:91
SCH_API Scalar getDistance()
function that returns the distance SQUARED between two convex objects, the distance is set to negativ...
SCH_API void setVector(const Vector3 &)
Intializes the direction vector (the vector between expected closest points) with a given value.
Scalar lambda0_
Definition: CD_Pair.h:111
void witPoints(Point3 &p1, Point3 &p2)
S_Object * sObj2_
Definition: CD_Pair.h:97
CD_Simplex s_
Definition: CD_Pair.h:120
SCH_API CD_Pair(S_Object *Obj1, S_Object *Obj2)
constructor \IMPORTANT: to create a CD::Pair, two CD::S_Objects must have been created before,...
Scalar distance_
Definition: CD_Pair.h:105
Point3 p2_
Definition: CD_Pair.h:104
virtual SCH_API ~CD_Pair(void)
CD_SimplexEnhanced sp_
Definition: CD_Pair.h:122
S_ObjectTimeStamp stamp2_
Definition: CD_Pair.h:107
SCH_API const Vector3 & getVector() const
Gets the last direction vector (can be used to get a normal vector, especially when the distance is z...
S_Object * sObj1_
Definition: CD_Pair.h:97
Scalar epsilon_
Definition: CD_Pair.h:109
bool projectionComputed_
Definition: CD_Pair.h:114
CD_Simplex s2_
Definition: CD_Pair.h:120
bool witPointsAreComputed_
Definition: CD_Pair.h:118
Scalar det_
Definition: CD_Pair.h:112
SCH_API Scalar getDistanceWithoutPenetrationDepth()
function that returns the distance SQUARED between two convex objects, no interpenetration depth comp...
SCH_API bool isInCollision()
returns if there is collision or not. If the distance is not already computed, it does not recompute,...
CD_Depth depthPair
Definition: CD_Pair.h:126
SCH_API void setEpsilon(Scalar)
Sets the machine epsilon. Default is 1e-24.
SCH_API Scalar getClosestPoints(Point3 &p1, Point3 &p2)
function that returns the distance SQUARED between two convex objects, and computes the witness point...
CD_Simplex s1_
Definition: CD_Pair.h:120
SCH_API Scalar reComputeClosestPoints(Point3 &p1, Point3 &p2)
function that returns the distance SQUARED between two convex objects, restarting the computations fr...
int lastFeature2_
Definition: CD_Pair.h:99
Scalar lambda1_
Definition: CD_Pair.h:111
S_ObjectTimeStamp stamp1_
Definition: CD_Pair.h:107
Definition: CD_SimplexEnhanced.h:11
Definition: CD_Simplex.h:55
Definition: S_Object.h:72
Definition: CD_Pair.h:12
double Scalar
Definition: SCH_Types.h:23
#define SCH_API
Definition: sch_api.h:13
Definition: S_Object.h:18