use of spacegraph.space3d.phys.collision.narrow.VoronoiSimplexSolver in project narchy by automenta.
the class GhostObject method rayTest.
public void rayTest(v3 rayFromWorld, v3 rayToWorld, Collisions.RayResultCallback resultCallback) {
Transform rayFromTrans = new Transform();
rayFromTrans.setIdentity();
rayFromTrans.set(rayFromWorld);
Transform rayToTrans = new Transform();
rayToTrans.setIdentity();
rayToTrans.set(rayToWorld);
Transform tmpTrans = new Transform();
VoronoiSimplexSolver solver = new VoronoiSimplexSolver();
for (int i = 0; i < overlappingObjects.size(); i++) {
// return array[index];
Collidable collidable = overlappingObjects.get(i);
// only perform raycast if filterMask matches
if (resultCallback.needsCollision(collidable.broadphase)) {
Collisions.rayTestSingle(rayFromTrans, rayToTrans, collidable, collidable.shape(), collidable.getWorldTransform(tmpTrans), solver, resultCallback);
}
}
}
Aggregations