public class SkinClip extends Object implements Serializable, Iterable<JointChannel>
A single animation for a Skeleton
.
A Clip consists of JointChannel
s. There is at most one Channel for each joint in Skeleton.
A Clip is analogue of sub sequence in jPCT's Animation
.
This class is adapted from Ardor3D.
JointChannel
,
Serialized FormConstructor and Description |
---|
SkinClip(Skeleton skeleton,
JointChannel... channels)
Creates a new SkinClip.
|
SkinClip(Skeleton skeleton,
List<JointChannel> channels)
Creates a new SkinClip.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannel(JointChannel channel)
Adds a new channel.
|
void |
applyTo(float time,
SkeletonPose pose)
Applies channels in this clip to given
SkeletonPose |
String |
getName()
Returns name of this clip.
|
Skeleton |
getSkeleton()
Returns the
Skeleton this clip is related to. |
float |
getTime()
returns time of this clip in seconds.
|
Iterator<JointChannel> |
iterator()
Returns an iterator of channels.
|
boolean |
removeChannel(JointChannel channel)
Removes a channel.
|
void |
setName(String name)
Sets name of this clip.
|
String |
toString()
Returns string representation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public SkinClip(Skeleton skeleton, JointChannel... channels)
Creates a new SkinClip.
skeleton
- the skeleton this clip is related tochannels
- the channelspublic SkinClip(Skeleton skeleton, List<JointChannel> channels)
Creates a new SkinClip. Same as SkinClip(Skeleton, JointChannel...)
but uses a List instead of an array.
skeleton
- the skeleton this clip is related tochannels
- the channelspublic float getTime()
public void addChannel(JointChannel channel)
Adds a new channel.
IllegalStateException
- if there is already a channel related to jointpublic boolean removeChannel(JointChannel channel)
Removes a channel.
public void applyTo(float time, SkeletonPose pose)
Applies channels in this clip to given SkeletonPose
public String getName()
public void setName(String name)
public Iterator<JointChannel> iterator()
Returns an iterator of channels. Note some channels may be null.
iterator
in interface Iterable<JointChannel>