Search in sources :

Example 1 with VoronoiSimplexSolver

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);
        }
    }
}
Also used : Collidable(spacegraph.space3d.phys.Collidable) VoronoiSimplexSolver(spacegraph.space3d.phys.collision.narrow.VoronoiSimplexSolver) Transform(spacegraph.space3d.phys.math.Transform)

Aggregations

Collidable (spacegraph.space3d.phys.Collidable)1 VoronoiSimplexSolver (spacegraph.space3d.phys.collision.narrow.VoronoiSimplexSolver)1 Transform (spacegraph.space3d.phys.math.Transform)1