public class DefaultNodeModel extends AbstractNamedModelElement implements NodeModel
NodeModel| Constructor and Description |
|---|
DefaultNodeModel()
Creates a new instance
|
DefaultNodeModel(NodeModel other)
Copy constructor that creates a shallow copy with references
to the elements of the given model, except for the children and
MeshModel instances (which will be empty in the copy). |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(DefaultNodeModel child)
Add the given child node
|
void |
addMeshModel(MeshModel meshModel)
Add the given
MeshModel |
float[] |
computeGlobalTransform(float[] result)
Computes the global transform of this node.
|
float[] |
computeLocalTransform(float[] result)
Computes the local transform of this node.
|
static float[] |
computeLocalTransform(NodeModel nodeModel,
float[] result)
Compute the local transform of the given node.
|
java.util.function.Supplier<float[]> |
createGlobalTransformSupplier()
Creates a supplier for the global transform matrix of this node
model.
|
java.util.function.Supplier<float[]> |
createLocalTransformSupplier()
Creates a supplier for the local transform matrix of this node model.
|
CameraModel |
getCameraModel()
Returns the
CameraModel for this node, or null if
this node is not associated with a camera |
java.util.List<NodeModel> |
getChildren()
Returns an unmodifiable view on the list of children of this node
|
float[] |
getMatrix()
Returns a reference to the array storing the matrix of this node.
|
java.util.List<MeshModel> |
getMeshModels()
Returns an unmodifiable view on the list of
MeshModel instances
that are attached to this node. |
NodeModel |
getParent()
Returns the parent of this node, or
null if this is
a root node |
float[] |
getRotation()
Returns a reference to the array storing the rotation of this
node, or
null if no rotation was set |
float[] |
getScale()
Returns a reference to the array storing the scale of this
node, or
null if no scale was set |
SkinModel |
getSkinModel()
Returns the
SkinModel for this node, or null if
this node is not associated with a skin |
float[] |
getTranslation()
Returns a reference to the array storing the translation of this
node, or
null if no translation was set. |
float[] |
getWeights()
Returns a reference to the morph target weights,
or
null if no morph target weights have been defined |
void |
setCameraModel(CameraModel cameraModel)
Set the
CameraModel |
void |
setMatrix(float[] matrix)
Set the matrix of this node to be a reference to the given
array.
|
void |
setParent(DefaultNodeModel parent)
Set the parent of this node
|
void |
setRotation(float[] rotation)
Set the rotation of this node to be a reference to the given
array.
|
void |
setScale(float[] scale)
Set the scale of this node to be a reference to the given
array.
|
void |
setSkinModel(SkinModel skinModel)
Set the
SkinModel |
void |
setTranslation(float[] translation)
Set the translation of this node to be a reference to the given
array.
|
void |
setWeights(float[] weights)
Set the morph target weights to be a reference to the given
array.
|
getName, setNameaddExtension, getExtensions, getExtras, removeExtension, setExtensions, setExtrasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamegetExtensions, getExtraspublic void setParent(DefaultNodeModel parent)
parent - The parent nodepublic void addChild(DefaultNodeModel child)
child - The child nodepublic void addMeshModel(MeshModel meshModel)
MeshModelmeshModel - The MeshModelpublic void setSkinModel(SkinModel skinModel)
SkinModelskinModel - The SkinModelpublic void setCameraModel(CameraModel cameraModel)
CameraModelcameraModel - The CameraModelpublic NodeModel getParent()
NodeModelnull if this is
a root nodepublic java.util.List<NodeModel> getChildren()
NodeModelgetChildren in interface NodeModelpublic java.util.List<MeshModel> getMeshModels()
NodeModelMeshModel instances
that are attached to this node.getMeshModels in interface NodeModelMeshModel listpublic SkinModel getSkinModel()
NodeModelSkinModel for this node, or null if
this node is not associated with a skingetSkinModel in interface NodeModelSkinModelpublic CameraModel getCameraModel()
NodeModelCameraModel for this node, or null if
this node is not associated with a cameragetCameraModel in interface NodeModelCameraModelpublic void setMatrix(float[] matrix)
NodeModelnull, then
the translation,
rotation, and
scale properties will be used for determining the
local transform.public float[] getMatrix()
NodeModelnull if no matrix was set.public void setTranslation(float[] translation)
NodeModelsetTranslation in interface NodeModeltranslation - The translationpublic float[] getTranslation()
NodeModelnull if no translation was set.getTranslation in interface NodeModelpublic void setRotation(float[] rotation)
NodeModelsetRotation in interface NodeModelrotation - The rotationpublic float[] getRotation()
NodeModelnull if no rotation was setgetRotation in interface NodeModelpublic void setScale(float[] scale)
NodeModelpublic float[] getScale()
NodeModelnull if no scale was setpublic void setWeights(float[] weights)
NodeModelsetWeights in interface NodeModelweights - The weightspublic float[] getWeights()
NodeModelnull if no morph target weights have been definedgetWeights in interface NodeModelpublic float[] computeLocalTransform(float[] result)
NodeModelnull or does
not have a length of 16, then a new array with length 16 will be
created and returned.computeLocalTransform in interface NodeModelresult - The result arraypublic float[] computeGlobalTransform(float[] result)
NodeModelnull or does
not have a length of 16, then a new array with length 16 will be
created and returned.computeGlobalTransform in interface NodeModelresult - The result arraypublic java.util.function.Supplier<float[]> createGlobalTransformSupplier()
NodeModelcreateGlobalTransformSupplier in interface NodeModelpublic java.util.function.Supplier<float[]> createLocalTransformSupplier()
NodeModelcreateLocalTransformSupplier in interface NodeModelpublic static float[] computeLocalTransform(NodeModel nodeModel, float[] result)
getMatrix() (if it is not
null), or computed from the getTranslation(),
getRotation() and getScale(), if they
are not null, respectively.null or does
not have a length of 16, then a new array with length 16 will be
created and returned.nodeModel - The node. May not be null.result - The result arrayCopyright © 2022. All Rights Reserved.