|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.odejava.xode.XODEObject
org.odejava.xode.XODEContainer
public abstract class XODEContainer
Base XODE container (as defined in the spec)
| Field Summary | |
|---|---|
protected boolean |
absoluteTransform
|
protected org.openmali.vecmath2.Matrix4f |
cachedBodyRelTransform
|
protected org.openmali.vecmath2.Matrix4f |
cachedRootTransform
|
protected org.openmali.vecmath2.Matrix4f |
cachedTransform
|
protected org.openmali.vecmath2.Matrix4f |
relTransform
|
protected List<XODEObject> |
xodeObjects
|
| Fields inherited from class org.odejava.xode.XODEObject |
|---|
node, odeObject |
| Constructor Summary | |
|---|---|
protected |
XODEContainer()
|
|
XODEContainer(Node node)
|
|
XODEContainer(String name,
org.openmali.vecmath2.Matrix4f transform)
|
| Method Summary | |
|---|---|
void |
addChild(XODEObject toAdd)
Adds a child XODEObject to this container |
protected void |
addChildElements(Element parent,
Document doc)
|
void |
addChildren(World world,
Space space,
String namePrefix,
List<Object> odeList)
|
protected void |
addTransformElement(Element element,
Document doc)
Adds a new Element representing the transform of this container to the passed Element. |
void |
buildOde(World world,
Space space,
String namePrefix,
List<Object> odeList)
Constructs the ODE scene based on this XODE structure |
org.openmali.vecmath2.Matrix4f |
getBodyRelTransform()
Recursivly builds the transform of this container relative to its parent body. |
List<XODEObject> |
getChildren()
Returns a List containing all child XODEObjectS |
org.openmali.vecmath2.Tuple3f |
getPosition()
Gets a Vector representing the virtual world position of this object |
org.openmali.vecmath2.Matrix4f |
getRootTransform()
Returns the transform of the ancestor XODERoot or the identity matrix if none. |
org.openmali.vecmath2.Quaternion4f |
getRotation()
Gets a Quaternion representing the virtual world rotation of this object |
org.openmali.vecmath2.Matrix4f |
getTransform()
Gets the virtual world transform of this object. |
org.openmali.vecmath2.Matrix4f |
getTransform(org.openmali.vecmath2.Matrix4f transform)
Gets the virtual world transform of this object. |
protected XODETransform |
getXODETransform()
|
protected void |
invalidateTransformCache()
Forces recomputation of all transforms in the XODE tree next time getTransform, getPosition or getRotation is called. |
boolean |
isAbsoluteTransformMode()
Returns true if the transform mode for this object is absolute |
protected void |
parseTransform(Node xodeData)
Parses the transform from the XODE structured XML data |
void |
removeChild(XODEObject toRemove)
Removes a child XODEObject from this container |
void |
scrapDOMObjectCache()
Dereferences the cached XML Node object (if any) for this XODEContainer and all child XODEContainers and XODEObjects. |
void |
scrapODEObjectCache()
Dereferences the cached ODE object (if any) for this XODEContainer and all child XODEContainers and XODEObjects. |
void |
setAbsolute(boolean absolute)
Sets the transform mode. |
protected void |
setParent(XODEContainer parent)
Sets the parent of this object. and invalidates the transform cache for this branch of the XODE tree. |
void |
setPosition(org.openmali.vecmath2.Tuple3f position)
Sets the position of this object. |
void |
setRotation(org.openmali.vecmath2.Quaternion4f rotation)
Sets the rotation of this object. |
void |
setTransform(org.openmali.vecmath2.Matrix4f transform)
Sets the transform of this object. |
| Methods inherited from class org.odejava.xode.XODEObject |
|---|
buildElement, clone, getDOMNode, getFirstBodyAncestor, getFirstJointGroupAncestor, getFirstSpaceAncestor, getName, getODEObject, getParent, setName |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<XODEObject> xodeObjects
protected org.openmali.vecmath2.Matrix4f relTransform
protected boolean absoluteTransform
protected transient org.openmali.vecmath2.Matrix4f cachedTransform
protected transient org.openmali.vecmath2.Matrix4f cachedBodyRelTransform
protected transient org.openmali.vecmath2.Matrix4f cachedRootTransform
| Constructor Detail |
|---|
protected XODEContainer()
public XODEContainer(String name,
org.openmali.vecmath2.Matrix4f transform)
public XODEContainer(Node node)
| Method Detail |
|---|
protected void parseTransform(Node xodeData)
xodeData - the node to parsepublic org.openmali.vecmath2.Matrix4f getRootTransform()
public org.openmali.vecmath2.Matrix4f getBodyRelTransform()
XODEException - if no body ancestor was found
public void buildOde(World world,
Space space,
String namePrefix,
List<Object> odeList)
XODEObject
buildOde in class XODEObjectworld - the World to add created bodiesspace - the Space to add created geometrynamePrefix - string to prefix all namesodeList - list of all created ODE files (will be added to)
public void addChildren(World world,
Space space,
String namePrefix,
List<Object> odeList)
public void addChild(XODEObject toAdd)
toAdd - the XODEObject to addpublic void removeChild(XODEObject toRemove)
toRemove - the XODEObject to removepublic List<XODEObject> getChildren()
public final org.openmali.vecmath2.Matrix4f getTransform()
public final org.openmali.vecmath2.Matrix4f getTransform(org.openmali.vecmath2.Matrix4f transform)
transform - the Matrix to store the transform in (will be overwritten and returned)
public org.openmali.vecmath2.Tuple3f getPosition()
public org.openmali.vecmath2.Quaternion4f getRotation()
public void setPosition(org.openmali.vecmath2.Tuple3f position)
position - the new position of this object.setAbsolute(boolean)public void setRotation(org.openmali.vecmath2.Quaternion4f rotation)
rotation - the new rotation of this object.setAbsolute(boolean)public void setTransform(org.openmali.vecmath2.Matrix4f transform)
transform - the new transform of this object.setAbsolute(boolean)public void setAbsolute(boolean absolute)
absolute - true for absolute mode, false for relative modeisAbsoluteTransformMode()public boolean isAbsoluteTransformMode()
setTransform(org.openmali.vecmath2.Matrix4f)protected void invalidateTransformCache()
XODERoot.setRootTransform(org.openmali.vecmath2.Matrix4f)public void scrapODEObjectCache()
XODEObject.odeObjectpublic void scrapDOMObjectCache()
XODEObject.node
protected void addTransformElement(Element element,
Document doc)
element - the element to which the transform element will be addeddoc - the Document this Element will be associated with
protected void addChildElements(Element parent,
Document doc)
protected void setParent(XODEContainer parent)
addChild() method
of XODEContainer.
setParent in class XODEObjectparent - the parent of this object or null if there isn't one
XODEException - if this XODEObject has a parent and a non-null parent was passedaddChild(XODEObject)protected XODETransform getXODETransform()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||