|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Node
com.jme.animation.SkinNode
public class SkinNode
SkinNode defines a scene node that contains skinned mesh data. A skinned mesh is defined by a Geometry object representing the "skin" that is attached to a skeleton (or a tree of Bones). The orientation, translation of these bones define the position of the skin vertices. These bones can then be driven by an animation system to provide the animation of the skin. SkinNode defines for each vertex of the skin the bone that affects it and the weight (BoneInfluence) of that affect. This allows multiple bones to share a single vertex (although the total weight must add up to 1).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme.scene.Spatial |
---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
Field Summary | |
---|---|
protected Matrix4f |
bindMatrix
|
protected java.util.ArrayList<BoneInfluence>[][] |
cache
|
protected java.util.ArrayList<ConnectionPoint> |
connectionPoints
|
protected boolean |
needsRefresh
|
protected boolean |
newSkeletonAssigned
|
protected static Vector3f |
normal
|
protected Bone |
skeleton
|
protected Node |
skins
|
protected static Vector3f |
vertex
|
Fields inherited from class com.jme.scene.Node |
---|
children |
Fields inherited from class com.jme.scene.Spatial |
---|
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
Constructor Summary | |
---|---|
SkinNode()
Empty Constructor to be used internally only. |
|
SkinNode(java.lang.String name)
Constructor creates a new SkinNode object with the supplied name. |
Method Summary | |
---|---|
void |
addBoneInfluence(int geomIndex,
int vert,
Bone bone,
float weight)
addBoneInfluence defines how a vertex will be affected by a bone. |
void |
addBoneInfluence(int geomIndex,
int vert,
java.lang.String boneId,
float weight)
|
ConnectionPoint |
addConnectionPoint(java.lang.String name,
Bone b)
|
void |
addSkin(Geometry skin)
addSkins sets the skin that the SkinNode will affect. |
void |
assignSkeletonBoneInfluences()
|
void |
boneChanged(BoneChangeEvent e)
Invoked when the target of the listener has changed bone status. |
void |
childChange(Geometry geometry,
int index1,
int index2)
|
java.lang.String |
getAnimationString()
|
java.util.ArrayList<BoneInfluence>[][] |
getCache()
|
java.util.ArrayList<ConnectionPoint> |
getConnectionPoints()
|
int |
getInfluenceCount(int geomIndex)
|
Bone |
getSkeleton()
|
Node |
getSkins()
getSkin returns the skins (Geometry objects) that the SkinNode is currently controlling. |
boolean |
isExternalControl()
|
void |
normalizeWeights()
normalizeWeights insures that all vertex BoneInfluences equal 1. |
void |
normalizeWeights(int geomIndex)
|
void |
read(JMEImporter e)
|
void |
recreateCache()
recreateCache initializes the cache of BoneInfluences for use by the skin node. |
void |
regenInfluenceOffsets()
regenInfluenceOffsets calculate the offset of a particular vertex from a bone. |
void |
remapInfluences(VertMap[] mappings)
|
void |
remapInfluences(VertMap mappings,
int geomIndex)
|
void |
removeGeometry(int geomIndex)
|
void |
revertToBind()
|
void |
setAnimation(BoneAnimation anim)
|
void |
setAnimation(int index)
|
void |
setAnimation(java.lang.String name)
|
void |
setBindMatrix(Matrix4f mat)
|
void |
setCache(java.util.ArrayList<BoneInfluence>[][] cache)
|
void |
setExternalControl(boolean externalControl)
|
void |
setSkeleton(Bone b)
|
void |
setSkins(Node skins)
setSkin sets the skin that the SkinNode will affect. |
void |
updateGeometricState(float time,
boolean initiator)
updateGeometricState overrides Spatials updateGeometric state to update the assigned skeleton bone influences, if changed. |
void |
updateSkin()
updateSkin positions the vertices of the skin based on the bones and the BoneInfluences those bones have on the vertices. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.Node |
---|
applyRenderState, attachChild, attachChildAt, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, findCollisions, findPick, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, hasCollision, lockBounds, lockMeshes, lockShadows, lockTransforms, setModelBound, sortLights, swapChildren, unlockBounds, unlockMeshes, unlockShadows, unlockTransforms, updateModelBound, updateWorldBound, updateWorldData, updateWorldVectors |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jme.util.export.Savable |
---|
getClassTag |
Field Detail |
---|
protected static Vector3f vertex
protected static Vector3f normal
protected boolean needsRefresh
protected Node skins
protected Bone skeleton
protected java.util.ArrayList<BoneInfluence>[][] cache
protected java.util.ArrayList<ConnectionPoint> connectionPoints
protected transient boolean newSkeletonAssigned
protected transient Matrix4f bindMatrix
Constructor Detail |
---|
public SkinNode()
public SkinNode(java.lang.String name)
name
- the name of this SkinNodeMethod Detail |
---|
public Node getSkins()
public void setSkins(Node skins)
skins
- the skins that this SkinNode will affect.public void addSkin(Geometry skin)
skin
- an additional skin that this SkinNode will affect.public void addBoneInfluence(int geomIndex, int vert, Bone bone, float weight)
geomIndex
- the geometry child that contains the vertex to be affected.vert
- the index to the vertex.bone
- the bone that affects the vertex.weight
- the weight that the bone will affect the vertex.public void setAnimation(BoneAnimation anim)
public void setAnimation(int index)
public void setAnimation(java.lang.String name)
public java.lang.String getAnimationString()
public void addBoneInfluence(int geomIndex, int vert, java.lang.String boneId, float weight)
public ConnectionPoint addConnectionPoint(java.lang.String name, Bone b)
public java.util.ArrayList<ConnectionPoint> getConnectionPoints()
public void recreateCache()
public void updateGeometricState(float time, boolean initiator)
updateGeometricState
in class Spatial
time
- the time that has passed between calls.initiator
- true if this is the top level being called.public void normalizeWeights()
public int getInfluenceCount(int geomIndex)
public void normalizeWeights(int geomIndex)
public void setSkeleton(Bone b)
public Bone getSkeleton()
public void assignSkeletonBoneInfluences()
public void regenInfluenceOffsets()
public void updateSkin()
public java.util.ArrayList<BoneInfluence>[][] getCache()
public void setCache(java.util.ArrayList<BoneInfluence>[][] cache)
public void setBindMatrix(Matrix4f mat)
public void childChange(Geometry geometry, int index1, int index2)
childChange
in class Node
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class Node
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class Node
java.io.IOException
public void revertToBind()
public void boneChanged(BoneChangeEvent e)
BoneChangeListener
boneChanged
in interface BoneChangeListener
e
- a ChangeEvent objectpublic void remapInfluences(VertMap[] mappings)
public void remapInfluences(VertMap mappings, int geomIndex)
public void removeGeometry(int geomIndex)
public void setExternalControl(boolean externalControl)
public boolean isExternalControl()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |