public class PoseClip extends Object implements Serializable, Iterable<MeshChannel>
A single animation in pose animation. May be related to single or multiple objects.
A PoseClip consists of MeshChannel
s. There is at most one MeshChannel for each Animated3D
in object group.
A PoseClip is analogue of sub sequence in jPCT's Animation
except a pose clip can span multiple objects.
MeshChannel
,
Serialized FormConstructor and Description |
---|
PoseClip(int groupSize,
List<MeshChannel> channels)
Creates a new PoseClip.
|
PoseClip(int groupSize,
MeshChannel... channels)
Creates a new PoseClip.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannel(MeshChannel channel)
Adds a new channel.
|
void |
applyTo(float time,
Animated3D target,
float weight)
Applies channels in this clip to given
Animated3D . |
void |
applyTo(float time,
AnimatedGroup targetGroup,
float weight)
Applies channels in this clip to given
AnimatedGroup . |
String |
getName()
Returns name of this clip.
|
float |
getTime()
returns time of this clip in seconds.
|
Iterator<MeshChannel> |
iterator()
Returns an iterator of channels.
|
boolean |
removeChannel(MeshChannel 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 PoseClip(int groupSize, MeshChannel... channels)
Creates a new PoseClip.
groupSize
- the size AnimatedGroup
this clip is intended to be applied.channels
- the channelspublic PoseClip(int groupSize, List<MeshChannel> channels)
Creates a new PoseClip. Same as PoseClip(int, MeshChannel...)
but uses a List instead of an array.
groupSize
- the size AnimatedGroup
this clip is intended to be applied.channels
- the channelspublic float getTime()
public void addChannel(MeshChannel channel)
Adds a new channel.
IllegalStateException
- if there is already a channel related to same objectpublic boolean removeChannel(MeshChannel channel)
Removes a channel.
public void applyTo(float time, AnimatedGroup targetGroup, float weight)
AnimatedGroup
. Animations are cumulative.
The Meshes are not changed by calling this method.public void applyTo(float time, Animated3D target, float weight)
Animated3D
. Animations are cumulative.
The Mesh is not changed by calling this method.public String getName()
public void setName(String name)
public Iterator<MeshChannel> iterator()
Returns an iterator of channels. Note some channels may be null.
iterator
in interface Iterable<MeshChannel>