Class Pose
java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.pose.Pose
- All Implemented Interfaces:
PoseChangeListener,EventListener
- Direct Known Subclasses:
AttachmentPoint,Camera,CelestialBody,Limb,LookAt,MeshInstance,ODENode,SpaceShip
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPoseChangeListener(PoseChangeListener listener) voidfromJSON(org.json.JSONObject from) Deserialize this node and its children from a JSON object and its children.voidgetComponents(List<JPanel> list) Build a Swing Component that represents this Node.getIcon()Set a custom icon for this node.javax.vecmath.Matrix4dgetLocal()javax.vecmath.Vector3djavax.vecmath.Vector3dgetRotationEuler(MatrixHelper.EulerSequence orderOfRotation) javax.vecmath.Matrix4dgetWorld()voidonPoseChange(Pose pose) Override this method to receive pose change events from the parent.voidremovePoseChangeListener(PoseChangeListener listener) voidsetLocal(javax.vecmath.Matrix4d m) Set the local transform of this pose.voidsetPosition(javax.vecmath.Vector3d p) Set the local position of this pose.voidsetRotationEuler(javax.vecmath.Vector3d r, MatrixHelper.EulerSequence orderOfRotation) Set the local rotation of this pose using Euler angles.voidsetRotationIndex(MatrixHelper.EulerSequence rotationIndex) voidsetWorld(javax.vecmath.Matrix4d m) Set the world transform of this pose.org.json.JSONObjecttoJSON()Serialize this node and its children to a JSON object and its children.Methods inherited from class com.marginallyclever.ro3.node.Node
addAttachListener, addChild, addChild, addDetachListener, addReadyListener, addRenameListener, findByPath, findChild, findChild, findFirstChild, findFirstSibling, findNodeByID, findParent, findParent, getAbsolutePath, getChildren, getName, getParent, getRootNode, getUniqueID, hasParent, isNameUsedBySibling, removeAttachListener, removeChild, removeDetachListener, removeReadyListener, removeRenameListener, setName, update, witnessProtection
-
Constructor Details
-
Pose
public Pose() -
Pose
-
-
Method Details
-
addPoseChangeListener
-
removePoseChangeListener
-
getComponents
Build a Swing Component that represents this Node.- Overrides:
getComponentsin classNode- Parameters:
list- the list to add components to.
-
getLocal
public javax.vecmath.Matrix4d getLocal() -
setLocal
public void setLocal(javax.vecmath.Matrix4d m) Set the local transform of this pose. This is the best method to override if you want to capture changes to the local OR world transform.- Parameters:
m- the new local transform.
-
getWorld
public javax.vecmath.Matrix4d getWorld()- Returns:
- the world transform of this pose.
-
setWorld
public void setWorld(javax.vecmath.Matrix4d m) Set the world transform of this pose. All cases callsetLocal(Matrix4d).- Parameters:
m- the new world transform.
-
getRotationEuler
- Parameters:
orderOfRotation- the order of rotation.- Returns:
- the local rotation of this pose using Euler angles in degrees.
-
setRotationEuler
Set the local rotation of this pose using Euler angles.- Parameters:
r- Euler angles in degrees.orderOfRotation- the order of rotation.
-
getPosition
public javax.vecmath.Vector3d getPosition()- Returns:
- the local position of this pose.
-
setPosition
public void setPosition(javax.vecmath.Vector3d p) Set the local position of this pose.- Parameters:
p- the new position.
-
toJSON
public org.json.JSONObject toJSON()Description copied from class:NodeSerialize this node and its children to a JSON object and its children. Classes that override this method should call super.toJSON() first, then add to the object returned. -
fromJSON
public void fromJSON(org.json.JSONObject from) Description copied from class:NodeDeserialize this node and its children from a JSON object and its children. Classes that override this method should call super.fromJSON(). When they do it will trigger the creation of child nodes. The child nodes will then call their own fromJSON() methods. -
getRotationIndex
-
setRotationIndex
-
getIcon
-
getParentPose
-
onPoseChange
Override this method to receive pose change events from the parent.- Specified by:
onPoseChangein interfacePoseChangeListener- Parameters:
pose- the parent pose that has changed.
-