Class: Dynamics

bu.interaction. Dynamics

Represents how a control parameter changes. It is emitted by events of classes that inherit from bu.interaction.Interaction.


new Dynamics()

Source:
bu/interaction/dynamics.js

Methods


<static> equals(d1, d2)

Returns true or false if both d1 and d2 objects are equal.

Parameters:
Name Type Description
d1 bu.interaction.Dynamics

Object 1.

d2 bu.interaction.Dynamics

Object 2.

Source:
bu/interaction/dynamics.js
Returns:

Return true or false.

Type
boolean

equals(other)

Returns true or false if other and this object are equal.

Parameters:
Name Type Description
other bu.interaction.Dynamics

Object.

Source:
bu/interaction/dynamics.js
Returns:

Return true or false.

Type
boolean

nullVelocityTime()

Returns the time to stop.

Source:
bu/interaction/dynamics.js
Returns:

Return zero if there isn't any velocity, Infinity if there isn't any friction, or the time to stop if both exist.

Type
number

offsetFromVelocity(elapsed)

Returns offset after a time.

Parameters:
Name Type Description
elapsed number

Time in milliseconds to pass.

Source:
bu/interaction/dynamics.js
Returns:

Return the new offset.

Type
number

reset()

Reinitialize values.

Source:
bu/interaction/dynamics.js

toString()

Returns a string representation of this param.

Source:
bu/interaction/dynamics.js
Returns:
Type
string

update(other, elapsed)

Updates this object with values from other object.

Parameters:
Name Type Description
other bu.interaction.Dynamics

Object.

elapsed number

Time in milliseconds to apply the update.

Source:
bu/interaction/dynamics.js
Returns:

Return true or false.

Type
boolean

velocityAfter(elapsed)

Returns velocity after a time.

Parameters:
Name Type Description
elapsed number

Time in milliseconds to pass.

Source:
bu/interaction/dynamics.js
Returns:

Return the new velocity or null if there isn't any.

Type
number