| 285 | } |
| 286 | |
| 287 | collide2::CollisionConstraint * makeCollisionConstraint (RTCScene scene, unsigned qID, unsigned cGeomID, unsigned cPrimID) |
| 288 | { |
| 289 | auto x0 = meshes[cGeomID]->x_[meshes[cGeomID]->tris_[cPrimID].v0]; |
| 290 | auto x1 = meshes[cGeomID]->x_[meshes[cGeomID]->tris_[cPrimID].v1]; |
| 291 | auto x2 = meshes[cGeomID]->x_[meshes[cGeomID]->tris_[cPrimID].v2]; |
| 292 | collide2::vec_t e0, e1; |
| 293 | e0.x = x1.x - x0.x; |
| 294 | e0.y = x1.y - x0.y; |
| 295 | e0.z = x1.z - x0.z; |
| 296 | e1.x = x2.x - x1.x; |
| 297 | e1.y = x2.y - x1.y; |
| 298 | e1.z = x2.z - x1.z; |
| 299 | auto collNorm = normalize (cross (e0, e1)); |
| 300 | auto c = new collide2::CollisionConstraint (); |
| 301 | c->initConstraint (qID, x0, collNorm, collDelta); |
| 302 | return c; |
| 303 | } |
| 304 | |
| 305 | void addCollisionConstraints (RTCScene scene) |
| 306 | { |
no test coverage detected