hmi.physics.controller
Class ScriptJointController

java.lang.Object
  extended by hmi.physics.controller.ScriptController
      extended by hmi.physics.controller.ScriptJointController
All Implemented Interfaces:
PhysicalController

public class ScriptJointController
extends ScriptController

The ScriptJointController controls a single joint, using a Rhino (javascript syntax) script. The update(timediff) function in the script is called every frame. PhysicalJoint joint can be used in the script to set up joint torque, etc.

Author:
welberge

Field Summary
private  String[] desJointIDs
           
private  PhysicalJoint joint
           
private  String[] jointIDs
           
 
Fields inherited from class hmi.physics.controller.ScriptController
jsEngine
 
Constructor Summary
ScriptJointController(PhysicalJoint pj)
          Constructor
 
Method Summary
 PhysicalController copy(PhysicalHumanoid ph)
          Creates a copy of the controller
 String[] getDesiredJointIDs()
          Gets the ids of joints the controller would like to steer if available
 String getParameterValue(String name)
          Get the parameter value of parameter name, return null if not found
 String[] getRequiredJointIDs()
          Gets the ids of controlled joints
 void setParameterValue(String name, float value)
           
 void setParameterValue(String name, String value)
           
 void setPhysicalHumanoid(PhysicalHumanoid ph)
          Links the controller to a new set of physical joints
 
Methods inherited from class hmi.physics.controller.ScriptController
getScript, reset, setScript, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

joint

private PhysicalJoint joint

jointIDs

private String[] jointIDs

desJointIDs

private String[] desJointIDs
Constructor Detail

ScriptJointController

public ScriptJointController(PhysicalJoint pj)
Constructor

Parameters:
pj - the controlled joint
Method Detail

getRequiredJointIDs

public String[] getRequiredJointIDs()
Description copied from interface: PhysicalController
Gets the ids of controlled joints


setPhysicalHumanoid

public void setPhysicalHumanoid(PhysicalHumanoid ph)
Description copied from interface: PhysicalController
Links the controller to a new set of physical joints

Parameters:
ph - physical humanoid to link to

copy

public PhysicalController copy(PhysicalHumanoid ph)
Description copied from interface: PhysicalController
Creates a copy of the controller


getParameterValue

public String getParameterValue(String name)
Description copied from interface: PhysicalController
Get the parameter value of parameter name, return null if not found


setParameterValue

public void setParameterValue(String name,
                              String value)

setParameterValue

public void setParameterValue(String name,
                              float value)

getDesiredJointIDs

public String[] getDesiredJointIDs()
Description copied from interface: PhysicalController
Gets the ids of joints the controller would like to steer if available