32 #include "qparticle.h"
33 #include "qobjectpool.h"
68 this->particle=particle;
69 this->position=position;
71 this->penetration=penetration;
72 this->referenceParticles=referenceParticles;
80 void Configure(
QParticle *particle,
QVector position,
QVector normal,
float penetration,vector<QParticle*> referenceParticles){
81 this->particle=particle;
82 this->position=position;
84 this->penetration=penetration;
85 this->referenceParticles=referenceParticles;
104 Project(
float projectMin,
int minPointIndex,
float projectMax,
int maxPointIndex){
107 minIndex=minPointIndex;
108 maxIndex=maxPointIndex;
110 float Overlap(
const Project other)
const{
111 float penetration=0.0f;
113 penetration=min-other.max;
115 penetration=other.min-max;
130 static void PolygonAndPolygon(vector<QParticle*> &particlesA,vector<QParticle*> &particlesB,vector<QCollision::Contact*> &contacts);
136 static void CircleAndPolygon(vector<QParticle*> &circleParticles,vector<QParticle*> &polygonParticles,vector<QCollision::Contact*> &contacts);
142 static void CircleAndCircle(vector<QParticle*> &particlesA,vector<QParticle*> &particlesB,
QAABB boundingBoxB, vector<QCollision::Contact*> &contacts,
float specifiedRadius=0.0f);
150 static void PolylineAndPolygon(vector<QParticle*> &polylineParticles,vector<QParticle*> &polygonParticles,vector<QCollision::Contact*> &contacts);
159 static void CircleAndPolyline(vector<QParticle*> &circleParticles,vector<QParticle*> &polylineParticles,
QAABB polylineAABB , vector<QCollision::Contact*> &contacts,
bool circlesArePolygon=
false);
176 static bool PointInPolygon(
QVector &point, vector<QParticle*> &polygon );
182 static bool PointInPolygon(
QVector &point, vector<QVector> &polygon );
188 static bool PointInPolygon2(
QVector point, vector<QParticle*> &polygon );
195 static void ClipContactParticles(
QParticle *referenceParticles[],
QParticle *incidentParticles[], vector<QCollision::Contact*> &contacts );
196 static Project ProjectToAxis(
QVector &normal,vector<QParticle*> &polygon);
197 static pair<int,int> FindNearestSideOfPolygon(
const QVector point, vector<QParticle*> polygonParticles,
bool checkSideRange=
false);
198 static int FindNearestParticleOfPolygon(
QParticle * particle, vector<QParticle*> polygonParticles);
199 static int FindExtremeParticleOfAxis(vector<QParticle*> polygonParticles,
QVector axisNormal);
200 static bool PointInPolygonWN(
const QVector point, vector<QParticle*> polygonParticles);
The QCollision class performs all collision detection operations. The relevant methods return contact...
Definition: qcollision.h:44
QParticle objects form the network structures of QMesh objects defined for all body object types....
Definition: qparticle.h:37
A QWorld object is required to create a physics simulation. The QWorld class manages the entire physi...
Definition: qworld.h:51
Definition: qcollision.h:98