ThreeJS AnimationObjectGroup and Utils

AnimationObjectGroup

A group of objects that receives a shared animation state.

Usage

Add items you'd normally send as 'root' to AnimationMixer's function Object() { [native code] } or clipAction method, and instead pass this object as 'root.'

Because the mixer sees all objects of this class as one, cache control of the individual objects must be done on the group.

Limitations

All of the items in the group must have the same animation attributes.

A single attribute can be controlled directly or through a target group, but not both.

Constructor

AnimationObjectGroup( obj1 : Object, obj2 : Object, obj3 : Object, ... )

obj - an abitrary number of meshes that share the same animation state.

Properties

.stats : Object

An object that holds some of the AnimationObjectGroup's information (total number, number in use, number of bindings per object)

.uuid : String

The UUID of this AnimationObjectGroup. It gets automatically assigned and shouldn't be edited.

Methods

.add ( obj1 : Object, obj2 : Object, obj3 : Object, ... ) : undefined

Adds an arbitrary number of objects to this AnimationObjectGroup.

.remove ( obj1 : Object, obj2 : Object, obj3 : Object, ... ) : undefined

Removes an arbitrary number of objects from this AnimationObjectGroup.

.uncache ( obj1 : Object, obj2 : Object, obj3 : Object, ... ) : undefined

Deallocates all memory resources for the passed objects of this AnimationObjectGroup.

AnimationUtils

Internally, an object has several capabilities to aid with animations.

Methods

.arraySlice ( array, from, to ) : Array

This is the same as Array.prototype.slice, but also works on typed arrays.

.convertArray ( array, type, forceClone ) : Array

Converts an array to a specific type.

.flattenJSON ( jsonKeys, times, values, valuePropertyName ) : Array

Used for parsing AOS keyframe formats.

.getKeyframeOrder ( times ) : Array

Returns an array by which times and values can be sorted.

.isTypedArray ( object ) : Boolean

Returns true if the object is a typed array.

.makeClipAdditive ( targetClip : AnimationClip, referenceFrame : Number, referenceClip : AnimationClip, fps : Number ) : AnimationClip

Converts the keyframes of the given animation clip to an additive format.

.sortedArray ( values, stride, order ) : Array

Sorts the array previously returned by getKeyframeOrder.

.subclip ( clip : AnimationClip, name : String, startFrame : Number, endFrame : Number, fps : Number ) : AnimationClip

Creates a new clip that only contains the section of the original clip that occurs between the specified frames.