KeyFrame
Inheritance: java.lang.Object
public class KeyFrame
A key frame is mainly defined by a time and a value, for some interpolation types, tangent/tension/bias/continuity is also used by calculating the final sampled value. Sampled values in a non-key-frame time position is interpolated by key-frames between the previous and next key-frames Value before/after the first/last key-frame are calculated by the Extrapolation class.
Constructors
Constructor | Description |
---|---|
KeyFrame(KeyframeSequence curve, double time) | Create a new key frame on specified curve |
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getBias() | Gets the bias used in TCB spline |
getClass() | |
getContinuity() | Gets the continuity used in TCB spline |
getFlat() | Get or set if the key frame is flat. |
getIndependentTangent() | Gets the out and next in tangents are independent. |
getInterpolation() | Gets the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated. |
getNextInTangent() | Gets the next in(left) tangent on this key frame. |
getNextInWeight() | Gets the next in(left) weight on this key frame. |
getOutTangent() | Gets the out(right) tangent on this key frame. |
getOutWeight() | Gets the out(right) weight on this key frame. |
getStepMode() | Gets the key’s step mode. |
getTangentWeightMode() | Gets the key’s tangent weight mode. |
getTension() | Gets tension used in TCB spline |
getTime() | Gets the time position of list.data[index] key frame, measured in seconds. |
getTimeIndependentTangent() | Gets the tangent is time-independent |
getValue() | Gets the key-frame’s value. |
hashCode() | |
notify() | |
notifyAll() | |
setBias(float value) | Sets the bias used in TCB spline |
setContinuity(float value) | Sets the continuity used in TCB spline |
setFlat(boolean value) | Get or set if the key frame is flat. |
setIndependentTangent(boolean value) | Sets the out and next in tangents are independent. |
setInterpolation(Interpolation value) | Sets the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated. |
setNextInTangent(Vector2 value) | Sets the next in(left) tangent on this key frame. |
setNextInWeight(float value) | Sets the next in(left) weight on this key frame. |
setOutTangent(Vector2 value) | Sets the out(right) tangent on this key frame. |
setOutWeight(float value) | Sets the out(right) weight on this key frame. |
setStepMode(StepMode value) | Sets the key’s step mode. |
setTangentWeightMode(int value) | Sets the key’s tangent weight mode. |
setTension(float value) | Sets tension used in TCB spline |
setTime(double value) | Sets the time position of list.data[index] key frame, measured in seconds. |
setTimeIndependentTangent(boolean value) | Sets the tangent is time-independent |
setValue(float value) | Sets the key-frame’s value. |
toString() | Gets the string representation of the key frame |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
KeyFrame(KeyframeSequence curve, double time)
public KeyFrame(KeyframeSequence curve, double time)
Create a new key frame on specified curve
Parameters:
Parameter | Type | Description |
---|---|---|
curve | KeyframeSequence | The curve that the key frame will be created on |
time | double | The time position of the key frame |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getBias()
public float getBias()
Gets the bias used in TCB spline
Returns: float - the bias used in TCB spline
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getContinuity()
public float getContinuity()
Gets the continuity used in TCB spline
Returns: float - the continuity used in TCB spline
getFlat()
public boolean getFlat()
Get or set if the key frame is flat. Key frame should be flat if next or previous key frame has the same value. Flat key frame has flat tangents and fixed interpolation.
Returns: boolean - Get or set if the key frame is flat. Key frame should be flat if next or previous key frame has the same value. Flat key frame has flat tangents and fixed interpolation.
getIndependentTangent()
public boolean getIndependentTangent()
Gets the out and next in tangents are independent.
Returns: boolean - the out and next in tangents are independent.
getInterpolation()
public Interpolation getInterpolation()
Gets the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.
Returns: Interpolation - the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.
getNextInTangent()
public Vector2 getNextInTangent()
Gets the next in(left) tangent on this key frame.
Returns: Vector2 - the next in(left) tangent on this key frame.
getNextInWeight()
public float getNextInWeight()
Gets the next in(left) weight on this key frame.
Returns: float - the next in(left) weight on this key frame.
getOutTangent()
public Vector2 getOutTangent()
Gets the out(right) tangent on this key frame.
Returns: Vector2 - the out(right) tangent on this key frame.
getOutWeight()
public float getOutWeight()
Gets the out(right) weight on this key frame.
Returns: float - the out(right) weight on this key frame.
getStepMode()
public StepMode getStepMode()
Gets the key’s step mode. If the interpolation type is Interpolation.CONSTANT, list.data[index] decides which key-frame’s value will be used during interpolation. A StepMode.PREVIOUS_VALUE means the left key-frame’s value will be used A StepMode.NEXT_VALUE means the next right key-frame’s value will be used
Returns: StepMode - the key’s step mode. If the interpolation type is Interpolation.CONSTANT, list.data[index] decides which key-frame’s value will be used during interpolation. A StepMode.PREVIOUS_VALUE means the left key-frame’s value will be used A StepMode.NEXT_VALUE means the next right key-frame’s value will be used
getTangentWeightMode()
public int getTangentWeightMode()
Gets the key’s tangent weight mode. The out tangent or the next in tangent can be customized by select correct WeightedMode
Returns: int - the key’s tangent weight mode. The out tangent or the next in tangent can be customized by select correct WeightedMode
getTension()
public float getTension()
Gets tension used in TCB spline
Returns: float - tension used in TCB spline
getTime()
public double getTime()
Gets the time position of list.data[index] key frame, measured in seconds.
Returns: double - the time position of list.data[index] key frame, measured in seconds.
getTimeIndependentTangent()
public boolean getTimeIndependentTangent()
Gets the tangent is time-independent
Returns: boolean - the tangent is time-independent
getValue()
public float getValue()
Gets the key-frame’s value.
Returns: float - the key-frame’s value.
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setBias(float value)
public void setBias(float value)
Sets the bias used in TCB spline
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | New value |
setContinuity(float value)
public void setContinuity(float value)
Sets the continuity used in TCB spline
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | New value |
setFlat(boolean value)
public void setFlat(boolean value)
Get or set if the key frame is flat. Key frame should be flat if next or previous key frame has the same value. Flat key frame has flat tangents and fixed interpolation.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | New value |
setIndependentTangent(boolean value)
public void setIndependentTangent(boolean value)
Sets the out and next in tangents are independent.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | New value |
setInterpolation(Interpolation value)
public void setInterpolation(Interpolation value)
Sets the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Interpolation | New value |
setNextInTangent(Vector2 value)
public void setNextInTangent(Vector2 value)
Sets the next in(left) tangent on this key frame.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Vector2 | New value |
setNextInWeight(float value)
public void setNextInWeight(float value)
Sets the next in(left) weight on this key frame.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | New value |
setOutTangent(Vector2 value)
public void setOutTangent(Vector2 value)
Sets the out(right) tangent on this key frame.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Vector2 | New value |
setOutWeight(float value)
public void setOutWeight(float value)
Sets the out(right) weight on this key frame.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | New value |
setStepMode(StepMode value)
public void setStepMode(StepMode value)
Sets the key’s step mode. If the interpolation type is Interpolation.CONSTANT, list.data[index] decides which key-frame’s value will be used during interpolation. A StepMode.PREVIOUS_VALUE means the left key-frame’s value will be used A StepMode.NEXT_VALUE means the next right key-frame’s value will be used
Parameters:
Parameter | Type | Description |
---|---|---|
value | StepMode | New value |
setTangentWeightMode(int value)
public void setTangentWeightMode(int value)
Sets the key’s tangent weight mode. The out tangent or the next in tangent can be customized by select correct WeightedMode
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | New value |
setTension(float value)
public void setTension(float value)
Sets tension used in TCB spline
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | New value |
setTime(double value)
public void setTime(double value)
Sets the time position of list.data[index] key frame, measured in seconds.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | New value |
setTimeIndependentTangent(boolean value)
public void setTimeIndependentTangent(boolean value)
Sets the tangent is time-independent
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | New value |
setValue(float value)
public void setValue(float value)
Sets the key-frame’s value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | New value |
toString()
public String toString()
Gets the string representation of the key frame
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |