Package com.aspose.threed
Class KeyFrame
- java.lang.Object
-
- com.aspose.threed.KeyFrame
-
public class KeyFrame extends java.lang.Object
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 theExtrapolation
class.
-
-
Constructor Summary
Constructors Constructor Description KeyFrame(KeyframeSequence curve, double time)
Create a new key frame on specified curve
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getBias()
Gets the bias used in TCB splinefloat
getContinuity()
Gets the continuity used in TCB splineboolean
getFlat()
Get or set if the key frame is flat.boolean
getIndependentTangent()
Gets the out and next in tangents are independent.Interpolation
getInterpolation()
Gets the key's interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.Vector2
getNextInTangent()
Gets the next in(left) tangent on this key frame.float
getNextInWeight()
Gets the next in(left) weight on this key frame.Vector2
getOutTangent()
Gets the out(right) tangent on this key frame.float
getOutWeight()
Gets the out(right) weight on this key frame.StepMode
getStepMode()
Gets the key's step mode.int
getTangentWeightMode()
Gets the key's tangent weight mode.float
getTension()
Gets tension used in TCB splinedouble
getTime()
Gets the time position of list.data[index] key frame, measured in seconds.boolean
getTimeIndependentTangent()
Gets the tangent is time-independentfloat
getValue()
Gets the key-frame's value.void
setBias(float value)
Sets the bias used in TCB splinevoid
setContinuity(float value)
Sets the continuity used in TCB splinevoid
setFlat(boolean value)
Get or set if the key frame is flat.void
setIndependentTangent(boolean value)
Sets the out and next in tangents are independent.void
setInterpolation(Interpolation value)
Sets the key's interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.void
setNextInTangent(Vector2 value)
Sets the next in(left) tangent on this key frame.void
setNextInWeight(float value)
Sets the next in(left) weight on this key frame.void
setOutTangent(Vector2 value)
Sets the out(right) tangent on this key frame.void
setOutWeight(float value)
Sets the out(right) weight on this key frame.void
setStepMode(StepMode value)
Sets the key's step mode.void
setTangentWeightMode(int value)
Sets the key's tangent weight mode.void
setTension(float value)
Sets tension used in TCB splinevoid
setTime(double value)
Sets the time position of list.data[index] key frame, measured in seconds.void
setTimeIndependentTangent(boolean value)
Sets the tangent is time-independentvoid
setValue(float value)
Sets the key-frame's value.java.lang.String
toString()
Gets the string representation of the key frame
-
-
-
Constructor Detail
-
KeyFrame
public KeyFrame(KeyframeSequence curve, double time)
Create a new key frame on specified curve- Parameters:
curve
- The curve that the key frame will be created ontime
- The time position of the key frame
-
-
Method Detail
-
toString
public java.lang.String toString()
Gets the string representation of the key frame- Overrides:
toString
in classjava.lang.Object
-
getTime
public double getTime()
Gets the time position of list.data[index] key frame, measured in seconds.
-
setTime
public void setTime(double value)
Sets the time position of list.data[index] key frame, measured in seconds.- Parameters:
value
- New value
-
getValue
public float getValue()
Gets the key-frame's value.
-
setValue
public void setValue(float value)
Sets the key-frame's value.- Parameters:
value
- New value
-
getInterpolation
public Interpolation getInterpolation()
Gets the key's interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.
-
setInterpolation
public void setInterpolation(Interpolation value)
Sets the key's interpolation type, list.data[index] defines the algorithm how the sampled value is calculated.- Parameters:
value
- New value
-
getTangentWeightMode
public int getTangentWeightMode()
Gets the key's tangent weight mode. The out tangent or the next in tangent can be customized by select correctWeightedMode
-
setTangentWeightMode
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 correctWeightedMode
- Parameters:
value
- New value
-
getStepMode
public StepMode getStepMode()
Gets the key's step mode. If the interpolation type isInterpolation.CONSTANT
, list.data[index] decides which key-frame's value will be used during interpolation. AStepMode.PREVIOUS_VALUE
means the left key-frame's value will be used AStepMode.NEXT_VALUE
means the next right key-frame's value will be used
-
setStepMode
public void setStepMode(StepMode value)
Sets the key's step mode. If the interpolation type isInterpolation.CONSTANT
, list.data[index] decides which key-frame's value will be used during interpolation. AStepMode.PREVIOUS_VALUE
means the left key-frame's value will be used AStepMode.NEXT_VALUE
means the next right key-frame's value will be used- Parameters:
value
- New value
-
getNextInTangent
public Vector2 getNextInTangent()
Gets the next in(left) tangent on this key frame.
-
setNextInTangent
public void setNextInTangent(Vector2 value)
Sets the next in(left) tangent on this key frame.- Parameters:
value
- New value
-
getOutTangent
public Vector2 getOutTangent()
Gets the out(right) tangent on this key frame.
-
setOutTangent
public void setOutTangent(Vector2 value)
Sets the out(right) tangent on this key frame.- Parameters:
value
- New value
-
getOutWeight
public float getOutWeight()
Gets the out(right) weight on this key frame.
-
setOutWeight
public void setOutWeight(float value)
Sets the out(right) weight on this key frame.- Parameters:
value
- New value
-
getNextInWeight
public float getNextInWeight()
Gets the next in(left) weight on this key frame.
-
setNextInWeight
public void setNextInWeight(float value)
Sets the next in(left) weight on this key frame.- Parameters:
value
- New value
-
getTension
public float getTension()
Gets tension used in TCB spline
-
setTension
public void setTension(float value)
Sets tension used in TCB spline- Parameters:
value
- New value
-
getContinuity
public float getContinuity()
Gets the continuity used in TCB spline
-
setContinuity
public void setContinuity(float value)
Sets the continuity used in TCB spline- Parameters:
value
- New value
-
getBias
public float getBias()
Gets the bias used in TCB spline
-
setBias
public void setBias(float value)
Sets the bias used in TCB spline- Parameters:
value
- New value
-
getIndependentTangent
public boolean getIndependentTangent()
Gets the out and next in tangents are independent.
-
setIndependentTangent
public void setIndependentTangent(boolean value)
Sets the out and next in tangents are independent.- Parameters:
value
- New value
-
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.
-
setFlat
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:
value
- New value
-
getTimeIndependentTangent
public boolean getTimeIndependentTangent()
Gets the tangent is time-independent
-
setTimeIndependentTangent
public void setTimeIndependentTangent(boolean value)
Sets the tangent is time-independent- Parameters:
value
- New value
-
-