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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPoseChangeListener
(PoseChangeListener listener) void
fromJSON
(org.json.JSONObject from) Deserialize this node and its children from a JSON object and its children.void
getComponents
(List<JPanel> list) Build a Swing Component that represents this Node.getIcon()
Set a custom icon for this node.javax.vecmath.Matrix4d
getLocal()
javax.vecmath.Vector3d
javax.vecmath.Vector3d
getRotationEuler
(MatrixHelper.EulerSequence orderOfRotation) javax.vecmath.Matrix4d
getWorld()
void
onPoseChange
(Pose pose) Override this method to receive pose change events from the parent.void
removePoseChangeListener
(PoseChangeListener listener) void
setLocal
(javax.vecmath.Matrix4d m) Set the local transform of this pose.void
setPosition
(javax.vecmath.Vector3d p) Set the local position of this pose.void
setRotationEuler
(javax.vecmath.Vector3d r, MatrixHelper.EulerSequence orderOfRotation) Set the local rotation of this pose using Euler angles.void
setRotationIndex
(MatrixHelper.EulerSequence rotationIndex) void
setWorld
(javax.vecmath.Matrix4d m) Set the world transform of this pose.org.json.JSONObject
toJSON()
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:
getComponents
in 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:Node
Serialize 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:Node
Deserialize 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
Description copied from class:Node
Set a custom icon for this node. -
getParentPose
-
onPoseChange
Override this method to receive pose change events from the parent.- Specified by:
onPoseChange
in interfacePoseChangeListener
- Parameters:
pose
- the parent pose that has changed.
-