Component: Animator (Simulation)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.1 (Release)
Category Simulation


Image Animator component

Basic animation and physics simulation for a single object. The target object can be set in motion by a simulation macro call, and will then continue in motion under the control of the animator. Boundaries can be set beyond which the object cannot move, and the behaviour of the object defined when it meets them. Simple simulation of gravity and friction are also possible.

Examples

Simple example showing how to use the animator component to simulate the movement of several panel items. FC6 Icon.png Animation Animator.jpg

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.settings.


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 minimum or maximum boundaries (set below unless "off")

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

Stop - motion stops when the boundary is reached.

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

Bounce - the object reverses direction in this axis.

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 minimum or maximum boundaries (set below unless "off")

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

Stop - motion stops when the boundary is reached.

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

Bounce - the object reverses direction in this axis.

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 minimum or maximum boundaries (set below unless "off")

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

Stop - motion stops when the boundary is reached.

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

Bounce - the object reverses direction in this axis.