public class KeyFrame<T extends IData<T>> extends java.lang.Object implements java.lang.Cloneable, java.lang.Iterable<KeyData<T>>
| Modifier and Type | Class and Description |
|---|---|
static interface |
KeyFrame.ICompressorRule<T extends IData<T>> |
| Modifier and Type | Field and Description |
|---|---|
protected int |
size
Size: number of KeyData values registered/used in the array
|
protected float[] |
times
List of times
|
protected java.lang.Object |
values
List of values
|
| Modifier | Constructor and Description |
|---|---|
|
KeyFrame() |
|
KeyFrame(int initialCapacity) |
protected |
KeyFrame(int size,
float[] times,
java.lang.Object values) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
binarySearch(float time)
Binary search for speed-up
|
void |
clear()
Remove all keys
|
KeyFrame<T> |
clone() |
int |
compress(KeyFrame.ICompressorRule<T> rule)
|
float |
getEndTime() |
KeyData<T> |
getIndex(int index)
The implementation is free to return a copy or the actual object.
|
int |
getKeyIndexAfter(float time) |
int |
getKeyIndexBefore(float time) |
boolean |
getKeyRange(KeyRange<T> dst,
AnimNode node) |
boolean |
getKeyRange(KeyRange<T> dst,
float time) |
protected boolean |
getKeyRange(KeyRange<T> dst,
int i,
int j,
float t) |
float |
getStartTime() |
protected float |
getT(int i,
int j,
float time,
Animation animation) |
float |
getTimeAt(int index) |
void |
getValue(T dst,
AnimNode node) |
void |
getValue(T dst,
float time) |
protected void |
getValue(T dst,
float time,
Animation animation) |
T |
getValueAt(int index) |
int |
insert(float time,
T value) |
int |
insert(KeyData<T> keyData) |
void |
insertOrdered(float time,
T value,
int index) |
int |
insertTimes(java.util.Set<java.lang.Float> timesSet) |
boolean |
isEmpty() |
java.util.Iterator<KeyData<T>> |
iterator() |
protected boolean |
keys_add(float time,
T value) |
protected void |
keys_clear() |
protected KeyFrame<T> |
keys_clone() |
protected void |
keys_ensureCapacity(int minCapacity) |
protected float |
keys_get_time(int index) |
protected T |
keys_get_value(int index) |
protected KeyData<T> |
keys_get(int index) |
protected void |
keys_init(int capacity) |
protected void |
keys_insertElementAt(float time,
T value,
int index) |
protected KeyData<T> |
keys_remove(int index) |
protected void |
keys_removeBulk(boolean[] removed,
int numRemoved_) |
protected boolean |
keys_set(int index,
float time,
T value) |
protected void |
keys_set(KeyFrame<T> src) |
protected KeyFrame<T> |
keys_subRange(int startIndex,
int endIndex) |
protected void |
keys_trimToSize() |
void |
listKeyTimes(java.util.Set<java.lang.Float> timesSet) |
void |
listKeyTimes(java.util.Set<java.lang.Float> timesSet,
Animation anim) |
protected int |
nextSearch(int i,
float time,
Animation animation) |
void |
offsetTime(float timeOffset) |
protected boolean |
optiRemoveBulk(int numRemoved) |
static KeyFrame |
read(IByteInputStream in) |
KeyData<T> |
removeIndex(int index) |
void |
set(KeyFrame<T> src) |
boolean |
setIndex(int index,
KeyData<T> keyData) |
void |
setValueAt(int index,
T value) |
int |
size() |
KeyFrame<T> |
subRange(float startTime,
float endTime) |
KeyFrame<T> |
subRange(int startIndex,
int endIndex) |
void |
trimToSize() |
static void |
write(IByteOutputStream out,
KeyFrame<?> keys,
java.lang.Class<?> c) |
protected int size
protected float[] times
protected java.lang.Object values
public KeyFrame()
public KeyFrame(int initialCapacity)
initialCapacity - initial size of the vector of keys.protected KeyFrame(int size,
float[] times,
java.lang.Object values)
public static final KeyFrame read(IByteInputStream in) throws java.io.IOException
java.io.IOExceptionpublic static final void write(IByteOutputStream out, KeyFrame<?> keys, java.lang.Class<?> c) throws java.io.IOException
java.io.IOExceptionpublic final int size()
public final boolean isEmpty()
public final int insert(float time,
T value)
time - time of the key to insertvalue - value of the key to insertKeyData time already exist in thispublic final void insertOrdered(float time,
T value,
int index)
time - time of the key to insertvalue - value of the key to insertpublic final KeyFrame<T> subRange(float startTime, float endTime)
KeyFrame containing the subRange [startTime; endTime]public KeyFrame<T> subRange(int startIndex, int endIndex)
KeyFrame containing the key between the indices [startIndex; endIndex]public final void offsetTime(float timeOffset)
public final void clear()
public final void trimToSize()
public final KeyData<T> getIndex(int index)
setIndex(int, KeyData) to reflect the changes.public final T getValueAt(int index)
public final float getTimeAt(int index)
public final void setValueAt(int index,
T value)
value - set the value at the specified indexpublic final float getStartTime()
KeyFrame must contains at least one elementpublic final float getEndTime()
KeyFrame must contains at least one elementpublic final void getValue(T dst, float time)
public final boolean getKeyRange(KeyRange<T> dst, float time)
time - time in secondsdst - destination KeyRange to store result.public final boolean getKeyRange(KeyRange<T> dst, AnimNode node)
dst - destination KeyRange to store result.track - KeyRange to store result.public final int getKeyIndexBefore(float time)
time - public final int getKeyIndexAfter(float time)
time - public void listKeyTimes(java.util.Set<java.lang.Float> timesSet)
timesSet - set to contains the list of times of this KeyFramepublic void listKeyTimes(java.util.Set<java.lang.Float> timesSet,
Animation anim)
anim - animation to list timestimesSet - set to contains the list of times for the anim of this KeyFramepublic final int insertTimes(java.util.Set<java.lang.Float> timesSet)
timesSet - list of times to insert in this KeyFrame.protected final int binarySearch(float time)
protected final int nextSearch(int i,
float time,
Animation animation)
protected final float getT(int i,
int j,
float time,
Animation animation)
protected void keys_init(int capacity)
protected void keys_clear()
protected boolean keys_add(float time,
T value)
protected float keys_get_time(int index)
protected T keys_get_value(int index)
protected boolean keys_set(int index,
float time,
T value)
protected void keys_removeBulk(boolean[] removed,
int numRemoved_)
protected final boolean optiRemoveBulk(int numRemoved)
protected void keys_insertElementAt(float time,
T value,
int index)
protected void keys_trimToSize()
protected void keys_ensureCapacity(int minCapacity)
public int compress(KeyFrame.ICompressorRule<T> rule)
rule - compression ruleOptimizerBonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com