com.jmex.physics.util
Class PhysicsPicker

java.lang.Object
  extended by com.jmex.physics.util.PhysicsPicker

public class PhysicsPicker
extends java.lang.Object

A small tool to be able to pick the visual of physics nodes and move them around with the mouse.

Author:
Irrisor

Constructor Summary
PhysicsPicker(com.jme.input.InputHandler input, com.jme.scene.Node rootNode, PhysicsSpace physicsSpace)
          Constructor of the class.
PhysicsPicker(com.jme.input.InputHandler input, com.jme.scene.Node rootNode, PhysicsSpace physicsSpace, boolean allowRotation)
          Constructor of the class.
 
Method Summary
 void delete()
           
 com.jme.input.InputHandler getInputHandler()
           
 DynamicPhysicsNode getPickedNode()
           
 boolean isPickModeVisual()
           
 void setPickModeVisual(boolean pickModeVisual)
          The mode used for picking: visual picking uses the bounding volumes and visual meshes of scene elements to determine what was clicked by the user, the physical mode uses the actual physical representations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhysicsPicker

public PhysicsPicker(com.jme.input.InputHandler input,
                     com.jme.scene.Node rootNode,
                     PhysicsSpace physicsSpace)
Constructor of the class.

Parameters:
input - where getInputHandler() is attached to
rootNode - root node of the scene - used for picking
physicsSpace - physics space to create joints in (picked nodes must reside in there)

PhysicsPicker

public PhysicsPicker(com.jme.input.InputHandler input,
                     com.jme.scene.Node rootNode,
                     PhysicsSpace physicsSpace,
                     boolean allowRotation)
Constructor of the class.

Parameters:
input - where getInputHandler() is attached to
rootNode - root node of the scene - used for picking
physicsSpace - physics space to create joints in (picked nodes must reside in there)
allowRotation - true to allow rotation of the picked object
Method Detail

getInputHandler

public com.jme.input.InputHandler getInputHandler()
Returns:
the input handler for this picker

delete

public void delete()

getPickedNode

public DynamicPhysicsNode getPickedNode()

isPickModeVisual

public boolean isPickModeVisual()
Returns:
true if picking is done with the visuals, false if done with the physics representation
See Also:
setPickModeVisual(boolean)

setPickModeVisual

public void setPickModeVisual(boolean pickModeVisual)
The mode used for picking: visual picking uses the bounding volumes and visual meshes of scene elements to determine what was clicked by the user, the physical mode uses the actual physical representations.

Parameters:
pickModeVisual - true to switch to visual mode, false to switch to physical mode