Component: Motion Helper (Simulation)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.1 (Release)
Category Simulation


Image Motion Helper component

Helper for building components which require simulation of constant motion. Linked objects can be issued speed and acceleration parameters, and will then be animated automatically until another command is issued. The helper can control motion for up to four objects simultaneously, all with their own discrete motion settings.

Examples

Example showing how to use the motion helper component to easily assign motion to items on the panel. FC6 Icon.png Motion

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

RegisterTarget

Add a new object to the list of objects which the motion helper is animating.

Up to four objects can be animated by each Motion Helper.

Parameters

HANDLE Target
Handle of the target to link to.
HANDLE AxisObject
Axis object for this definition
BYTE Axis
Axis to move along/around (0=X, 1=Y, 2=Z)
BYTE Type
Motion type (0=Rotary, 1=Linear)


Return value

This call does not return a value


SetAcceleration

Sets the acceleration for the target object. This sets how quickly the object

reaches its new speed following a call to SetSpeed.

NB) The object must be one of those registered using RegisterTarget.

Parameters

HANDLE Target
Handle of the object to set the acceleration for.
FLOAT Acceleration
Time in milliseconds to reach a new speed.


Return value

This call does not return a value


SetSpeed

Set a new target speed for this object. Will use the acceleration parameter

to set how long it will take to reach the new speed.

NB) The object must be one of those previously declared using RegisterTarget

Parameters

HANDLE Target
Target object to set the speed for.
FLOAT Speed
Target speed. World units per second or degrees per second.


Return value

This call does not return a value


UnregisterAll

Totally clear the list of registered objects

Parameters

This macro has no parameters


Return value

This call does not return a value


UnregisterTarget

Remove a target from the list of links.

Parameters

HANDLE Target
Handle of the object to remove


Return value

This call does not return a value



Property reference

Frame Interval

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

Time interval between animation frames.

Does not affect the speed of motion, only the rate of screen updates.

On Stop

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

Decide what action to take when simulation stops.

No Action - Animation is paused, continues from this position when simulation restarts

Return to start - all object returned to their start positions, current speed resumes on simulation start.

Clear speeds - objects retain their position, but speed is set to zero.

Return and clear - objects return to start position and have theri speed set to zero.