Search in sources :

Example 1 with RayPickingVisitor

use of org.rajawali3d.visitors.RayPickingVisitor in project Rajawali by Rajawali.

the class RayPicker method getObjectAt.

public void getObjectAt(float x, float y) {
    Vector3 pointNear = mRenderer.unProject(x, y, 0);
    Vector3 pointFar = mRenderer.unProject(x, y, 1);
    RayPickingVisitor visitor = new RayPickingVisitor(pointNear, pointFar);
    //mRenderer.accept(visitor);
    // TODO: ray-triangle intersection test
    mObjectPickedListener.onObjectPicked(visitor.getPickedObject());
}
Also used : RayPickingVisitor(org.rajawali3d.visitors.RayPickingVisitor) Vector3(org.rajawali3d.math.vector.Vector3)

Aggregations

Vector3 (org.rajawali3d.math.vector.Vector3)1 RayPickingVisitor (org.rajawali3d.visitors.RayPickingVisitor)1