List of usage examples for javax.media.j3d PickBounds PickBounds
public PickBounds(Bounds boundsObject)
From source file:NodesTest.java
public void processStimulus(java.util.Enumeration criteria) { while (criteria.hasMoreElements()) { WakeupCriterion wakeUp = (WakeupCriterion) criteria.nextElement(); // every N frames, check for a collision if (wakeUp instanceof WakeupOnElapsedFrames) { // create a PickBounds PickTool pickTool = new PickTool(pickRoot); pickTool.setMode(PickTool.BOUNDS); BoundingSphere bounds = (BoundingSphere) collisionObject.getBounds(); pickBounds = new PickBounds(new BoundingSphere( new Point3d(positionVector.x, positionVector.y, positionVector.z), bounds.getRadius())); pickTool.setShape(pickBounds, new Point3d(0, 0, 0)); PickResult[] resultArray = pickTool.pickAll(); if (isCollision(resultArray)) onCollide();/*from ww w . j a va 2s. co m*/ else onMiss(); moveCollisionObject(); } } // assign the next WakeUpCondition, so we are notified again wakeupOn(m_WakeupCondition); }