| java.lang.Object com.sun.perseus.model.LeafMotionSegment
LeafMotionSegment | final class LeafMotionSegment implements MotionSegment(Code) | | Represents a time interval in an animation.
version: $Id: LeafMotionSegment.java,v 1.3 2006/06/29 10:47:32 ln156897 Exp $ |
Field Summary | |
float[][] | end The segment's end value. | float[][] | start The segment's begin value. |
Constructor Summary | |
public | LeafMotionSegment(LeafMotionSegment prevSegment, float x2, float y2, AnimateMotion motion) Builds a new motion segment for the given previous segment and
end value.
Parameters: prevSegment - the preceding segment. | public | LeafMotionSegment(float x1, float y1, float x2, float y2, AnimateMotion motion) Builds a new motion segment for the given start and end
points. |
Method Summary | |
public void | addToEnd(Object[] by) Adds the input value to this Segment's end value.
Parameters: by - the value to add. | public void | collapse(Segment seg, Animation anim) Collapses this segment with the one passed as a parameter.
Note that if the input segment is not of the same class
as this one, an IllegalArgumentException is thrown. | public void | compute(float p, float[][] w) Computes an interpolated value for the given penetration in the
segment.
Parameters: p - the segment penetration. | void | computeRotate(AnimateMotion motion) Computes the rotation component on the end value. | public Object[] | getEnd() | public float | getLength() | public Object[] | getStart() | public void | initialize() Should be called after the segment's configuration is complete
to give the segment's implementation a chance to initialize
internal data and cache values. | public boolean | isAdditive() true if this segment type supports addition. | public void | setStart(Object[] newStart) Sets the start value. | public void | setZeroStart() |
end | float[][] end(Code) | | The segment's end value.
|
start | float[][] start(Code) | | The segment's begin value.
|
LeafMotionSegment | public LeafMotionSegment(LeafMotionSegment prevSegment, float x2, float y2, AnimateMotion motion)(Code) | | Builds a new motion segment for the given previous segment and
end value.
Parameters: prevSegment - the preceding segment. Should not be null. Parameters: x2 - the motion's end point, on the x-axis Parameters: y2 - the motion's end point, on the y-axis Parameters: motion - the corresponding AnimateMotion |
LeafMotionSegment | public LeafMotionSegment(float x1, float y1, float x2, float y2, AnimateMotion motion)(Code) | | Builds a new motion segment for the given start and end
points.
Parameters: x1 - the motion's starting point on the x-axis Parameters: y1 - the motion's stating point, on the y-axis Parameters: x2 - the motion's end point, on the x-axis Parameters: y2 - the motion's end point, on the y-axis Parameters: motion - the corresponding AnimateMotion |
addToEnd | public void addToEnd(Object[] by)(Code) | | Adds the input value to this Segment's end value.
Parameters: by - the value to add. Throws IllegalArgumentException if thisSegment type is not additive or if the input value is incompatible (e.g.,different number of components or different number of dimensions on acomponent). |
collapse | public void collapse(Segment seg, Animation anim)(Code) | | Collapses this segment with the one passed as a parameter.
Note that if the input segment is not of the same class
as this one, an IllegalArgumentException is thrown. The
method also throws an exception if the input segment's
end does not have the same number of components as this
segment's end.
After this method is called, this segment's end value
is the one of the input seg parameter.
Parameters: seg - the Segment to collapse with this one. Parameters: anim - the Animation this segment is part of. |
compute | public void compute(float p, float[][] w)(Code) | | Computes an interpolated value for the given penetration in the
segment.
Parameters: p - the segment penetration. Should be in the [0, 1] range. Parameters: w - array where the computed value should be stored. |
computeRotate | void computeRotate(AnimateMotion motion)(Code) | | Computes the rotation component on the end value.
Parameters: motion - the associated AnimateMotion. |
getLength | public float getLength()(Code) | | Computes the 'motion' length for this segment
|
initialize | public void initialize()(Code) | | Should be called after the segment's configuration is complete
to give the segment's implementation a chance to initialize
internal data and cache values.
|
isAdditive | public boolean isAdditive()(Code) | | true if this segment type supports addition. falseotherwise. |
setStart | public void setStart(Object[] newStart)(Code) | | Sets the start value.
Parameters: newStart - the new segment start value. |
setZeroStart | public void setZeroStart()(Code) | | Sets the start value to its notion of 'zero'
|
|
|