Class: Animation

PD. Animation


new Animation()

Manages simple animations in the model.

Author:
  • drajmarsh

Members


:Array

animationsActive <static>

A list of currently active animations.

Type
  • Array

:Array

animationsComplete <static>

A list of completed animations that will soon be removed.

Type
  • Array

:boolean

isAnimating <static>

Whether or not one or more animations are currently in progress.

Type
  • boolean

Methods


animate() <static>

The callback method that handles active executing animations.


animateApertureOpenFraction( [element] [, aperture] [, open] [, parameter]) <static>

Animates aperture(s) between open and closed.

Parameters:
Name Type Argument Description
element BIM.Element <optional>

The element the aperture belongs to.

aperture BIM.Aperture <optional>

The aperture to animate, defaults to current selection set.

open number <optional>

The target open fraction value to animate to, will be determined if not given.

parameter PD.Parameter <optional>

The parameter to keep updated, will be searched for if not given.

Returns:

Returns true if fraction is different and animation started.

Type
boolean

animateCursorOpacity(cursor, opacity) <static>

Fades the 3D model cursor in or out to the given opacity.

Parameters:
Name Type Description
cursor PD.Cursor

The cursor to fade.

opacity number

The target opacity value to fade to.

Returns:

Returns true if opacity is different and animation started.

Type
boolean

animateDateTime(dateTime) <static>

Animates from the global date/time to the new date/time.

Parameters:
Name Type Description
dateTime PD.DateTime

The new date/time to animate to.

Returns:

Returns true if date/time is different and animation started.

Type
boolean

animateDisplaySettings( [surface_opacity] [, outline_opacity] [, outline_darkness] [, sunlight] [, skylight]) <static>

Scales the Z-axis of the given level by the given fraction.

Parameters:
Name Type Argument Description
surface_opacity number <optional>

The opacity of 3D surfaces within the model (0 to 1).

outline_opacity number <optional>

The opacity of 3D outlines within the model (0 to 1).

outline_darkness number <optional>

The lightness/darkness of 3D outlines within the model (0 to 1).

sunlight number <optional>

The lightness/darkness of direct sunshine within the model (0 to 1).

skylight number <optional>

The lightness/darkness of diffuse sky light within the model (0 to 1).

Returns:

Returns true if display settings are changed and animation started.

Type
boolean

animateDynamicOpacity(container, opacity [, duration]) <static>

Fades the given renderable container in or out to the given opacity.

Parameters:
Name Type Argument Description
container BIM.Renderable

The level or view to start fading.

opacity number

The target opacity value to fade to.

duration number <optional>

The duration of the animation, defaults to global transition speed.

Returns:

Returns true if opacity is different and animation started.

Type
boolean

animateElementOpenFraction( [element] [, open] [, parameter]) <static>

Animates element(s) between open and closed.

Parameters:
Name Type Argument Description
element BIM.Element <optional>

The element to animate, defaults to current selection set.

open number <optional>

The target open fraction value to animate to, will be determined if not given.

parameter PD.Parameter <optional>

The parameter to keep updated, will be searched for if not given.

Returns:

Returns true if fraction is different and animation started.

Type
boolean

animateLevelHighlight(level, mesh [, duration]) <static>

Fades the given renderable container in or out to the given opacity.

Parameters:
Name Type Argument Description
level BIM.Level

The level to temporarily highlight.

mesh PD.PolyMesh

The selection mesh to highlight it with.

duration number <optional>

The duration of the animation, defaults to global transition speed.

Returns:

Returns true if animation started.

Type
boolean

animateLevelVerticalScale(level, scale) <static>

Scales the Z-axis of the given level by the given fraction.

Parameters:
Name Type Description
level BIM.Level

The level to start fading.

scale number

The Z-axis scale to animate to.

Returns:

Returns true if opacity is different and animation started.

Type
boolean

animateObjectPosZ(obj, z [, options]) <static>

Animates the Z-axis position of an object.

Parameters:
Name Type Argument Description
obj THREE.Object3D

The object to animate.

z number

The Z-axis scale to animate to.

options object <optional>

An optional configuration object.

Properties of options:
Name Type Argument Description
duration number <optional>

An optional duration for the animation, in milliseconds, defaults to the default transition speed.

complete function <optional>

An optional callback function when complete.

Returns:

Returns true if the z pos is different and animation started.

Type
boolean

animatePolyMeshOpacity(mesh, to) <static>

Fades a geometry mesh in or out to the given opacity.

Parameters:
Name Type Description
mesh PD.PolyMesh

The mesh to fade.

to number

The target opacity value to fade to.

Returns:

Returns true if opacity is different and animation started.

Type
boolean

animateValue(from, to, callback) <static>

Animates a value and invokes the given callback function in steps.

Parameters:
Name Type Description
from number

The existing value.

to number

The value to animate to.

callback function

The callback function to invoke on each step.

Returns:

Returns true if the values are different and animation started.

Type
boolean

cancel() <static>

Call this method to cancel all animations that are currently in progress.

After this method has been called, all currently active animations will jump to their end frame and be completed.


startAnimation(callback, payload [, options]) <static>

Adds an animation to the active animations list.

This method returns an object with basic metadata about the animation. You do not need to store this object, unless you may want to terminate the animation before it naturally completes. In this case, you can pass this object to the PD.Animation.stopAnimation method.

Parameters:
Name Type Argument Description
callback function

A function to invoke in the form callback(payload, fraction).

payload object

An object to use as the first argument to the callback function.

options object <optional>

An optional configuration object.

Properties of options:
Name Type Argument Description
duration number <optional>

An optional duration for the animation, in milliseconds, defaults to the default transition speed.

noredraw boolean <optional>

An optional flag to indicate that the animation does not affect the model, defaults to false.

complete function <optional>

An optional callback function when complete, defaults to null.

Returns:

Returns a new animation metadata object.

Type
object

stopAnimation(anim) <static>

Stop and remove the given animation from the active animations list.

This will stop the given animation in its current state and invoke its complete callback function if it has one.

Parameters:
Name Type Description
anim object

The animation to remove, as returned by PD.Animation.startAnimation.