Component: Animator (Simulation)

From Flowcode Help
Revision as of 13:05, 16 January 2014 by JonnyW (talk | contribs) (XML import)
Jump to navigationJump to search


Author Matrix Ltd
Version 1.0
Category Simulation


Image Animator component

Module for animating other objects. Can automatically move an object linearly or rotate it. Optionally, define boundaries which the object cannot cross, and simple simulations of gravity and friction.

Examples

No additional examples


Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

Stop

Stops the motion of the object - it will retain its position unless simulation is stopped

with 'Return to Zero' selected.

Parameters

This macro has no parameters


Return value

This call does not return a value


SetSpeed

Set the linear and rotational velocity of the object. Motion continues without

any further intervention, subject to the friction, gravity and boundary settings.

Parameters

FLOAT AlongX
Speed along the X-axis. World units per second.
FLOAT AlongY
Speed along the Y-axis. World units per second.
FLOAT AlongZ
Speed along the Z-axis. World units per second.
FLOAT AroundX
Rotational speed around the X-axis. Degrees per second.
FLOAT AroundY
Rotational speed around the Y-axis. Degrees per second.
FLOAT AroundZ
Rotational speed around the Z-axis. Degrees per second.
FLOAT Acceleration
Time in milliseconds to accelerate to the new speed.


Return value

This call does not return a value



Property reference

Target

This property is of type Panel object and can be referenced with the variable name target_object.

The object that the animator is to move.

Axis

This property is of type Fixed list of ints and can be referenced with the variable name axis_object.

Reference frame for the axes of motion.

Object - use the target's own axes e.g. a vehicle,which always moves in the direction it is pointing.

World - use the world axes of the system panel - e.g. when using the 'gravity' setting.

Interval (ms)

This property is of type Unsigned integer and can be referenced with the variable name interval.

The amount of time between frames in milliseconds.

This does not change the speed of travel, only the regularity of screen updates.

On Stop

This property is of type Fixed list of ints and can be referenced with the variable name on_stop.

What to do when simulation stops.

Freeze - the motion is paused. Position and speed are retained, simulation resumes with these settings.

Return to Zero - the object returns to the start position, but its speed is remembered.

Zero speed - the object keeps its final position, but the speed is set to zero.

Return and Zero - the object retuirns to the start position, and speed is set to zero.

Gravity

This property is of type Floating point and can be referenced with the variable name gravity.

Simple simulation of accelleration due to gravity. Always acts along the negative X world axis ("down").

Range...

0.0 - no gravity.

> 0 - a pul along the downward Z-axis.

Friction

This property is of type Floating point and can be referenced with the variable name friction.

Simple friction simulation. Once a steady state is reached after any SetSpeed macro, the velocities

will exponentially decay away.

0.0...No friction, movements continue until stopped by macro or simulation end.

1.0...Infinite friction - object will stop dead as soon as SetSpeed acceleration is complete.

Mode

This property is of type Fixed list of ints and can be referenced with the variable name boundX_mode.

Set the behaviour when the object reaches the minimum or maximum boundaries.

Off - no boundaries, the object can continue along this acis indefinitely.

Stop - motion stops when the boundary is reached.

Wrap - when 'min' is reached, the object re-appears at 'max', and vice versa.

Bounce - motion along the axis is reversed.

Mode

This property is of type Fixed list of ints and can be referenced with the variable name boundY_mode.

Set the behaviour when the object reaches the minimum or maximum boundaries.

Off - no boundaries, the object can continue along this acis indefinitely.

Stop - motion stops when the boundary is reached.

Wrap - when 'min' is reached, the object re-appears at 'max', and vice versa.

Bounce - motion along the axis is reversed.

Mode

This property is of type Fixed list of ints and can be referenced with the variable name boundZ_mode.

Set the behaviour when the object reaches the minimum or maximum boundaries.

Off - no boundaries, the object can continue along this acis indefinitely.

Stop - motion stops when the boundary is reached.

Wrap - when 'min' is reached, the object re-appears at 'max', and vice versa.

Bounce - motion along the axis is reversed.