Documentation ¶
Overview ¶
Package animation
Index ¶
- Constants
- type Animation
- func (anim *Animation) AddChannel(ch IChannel)
- func (anim *Animation) Loop() bool
- func (anim *Animation) Name() string
- func (anim *Animation) Paused() bool
- func (anim *Animation) Reset()
- func (anim *Animation) SetLoop(state bool)
- func (anim *Animation) SetName(name string)
- func (anim *Animation) SetPaused(state bool)
- func (anim *Animation) SetSpeed(speed float32)
- func (anim *Animation) SetStart(v float32)
- func (anim *Animation) Speed() float32
- func (anim *Animation) Update(delta float32)
- type Channel
- func (c *Channel) InterpolationTangents() (inTangent, outTangent math32.ArrayF32)
- func (c *Channel) InterpolationType() InterpolationType
- func (c *Channel) Keyframes() math32.ArrayF32
- func (c *Channel) SetBuffers(keyframes, values math32.ArrayF32)
- func (c *Channel) SetInterpolationTangents(inTangent, outTangent math32.ArrayF32)
- func (c *Channel) SetInterpolationType(it InterpolationType)
- func (c *Channel) Update(time float32)
- func (c *Channel) Values() math32.ArrayF32
- type IChannel
- type InterpolationType
- type MorphChannel
- type NodeChannel
- type PositionChannel
- type RotationChannel
- type ScaleChannel
Constants ¶
const ( STEP = InterpolationType("STEP") // The animated values remain constant to the output of the first keyframe, until the next keyframe. LINEAR = InterpolationType("LINEAR") // The animated values are linearly interpolated between keyframes. Spherical linear interpolation (slerp) is used to interpolate quaternions. CUBICSPLINE = InterpolationType("CUBICSPLINE") // TODO )
The various interpolation types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
Animation is a keyframe animation, containing channels. Each channel animates a specific property of an object. Animations can span multiple objects and properties.
func NewAnimation ¶
func NewAnimation() *Animation
NewAnimation creates and returns a pointer to a new Animation object.
func (*Animation) AddChannel ¶
AddChannel adds a channel to the animation.
func (*Animation) Reset ¶
func (anim *Animation) Reset()
Reset resets the animation to the beginning.
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
A Channel associates an animation parameter channel to an interpolation sampler
func (*Channel) InterpolationTangents ¶
InterpolationTangents sets the interpolation tangents
func (*Channel) InterpolationType ¶
func (c *Channel) InterpolationType() InterpolationType
InterpolationType returns the current interpolation type.
func (*Channel) SetBuffers ¶
SetBuffers sets the keyframe and value buffers.
func (*Channel) SetInterpolationTangents ¶
SetInterpolationTangents sets the interpolation tangents.
func (*Channel) SetInterpolationType ¶
func (c *Channel) SetInterpolationType(it InterpolationType)
SetInterpolationType sets the interpolation type for this channel.
type IChannel ¶
type IChannel interface { Update(time float32) SetBuffers(keyframes, values math32.ArrayF32) Keyframes() math32.ArrayF32 Values() math32.ArrayF32 SetInterpolationType(it InterpolationType) }
IChannel is the interface for all channel types.
type InterpolationType ¶
type InterpolationType string
InterpolationType specifies the interpolation type.
type MorphChannel ¶
type MorphChannel struct { Channel // contains filtered or unexported fields }
MorphChannel is the IChannel for morph geometries.
func NewMorphChannel ¶
func NewMorphChannel(mg *geometry.MorphGeometry) *MorphChannel
type NodeChannel ¶
type NodeChannel struct { Channel // contains filtered or unexported fields }
NodeChannel is the IChannel for all node transforms.
type PositionChannel ¶
type PositionChannel NodeChannel
PositionChannel is the animation channel for a node's position.
func NewPositionChannel ¶
func NewPositionChannel(node core.INode) *PositionChannel
type RotationChannel ¶
type RotationChannel NodeChannel
RotationChannel is the animation channel for a node's rotation.
func NewRotationChannel ¶
func NewRotationChannel(node core.INode) *RotationChannel
type ScaleChannel ¶
type ScaleChannel NodeChannel
ScaleChannel is the animation channel for a node's scale.
func NewScaleChannel ¶
func NewScaleChannel(node core.INode) *ScaleChannel