Jump to content

Component: Motion Helper (Misc): Difference between revisions

From Flowcode Help
Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.1 |- | width="20%" style="color:gray..."
 
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(14 intermediate revisions by 2 users not shown)
Line 15: Line 15:
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.  
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.  


==Component Pack==
==Component Source Code==


FREE
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Motion_Helper.fcfx FC_Comp_Source_Motion_Helper.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Motion_Helper.fcfx FC_Comp_Source_Motion_Helper.fcfx]


==Detailed description==
==Detailed description==




Line 32: Line 48:


==Examples==
==Examples==




Line 45: Line 75:
{{Fcfile|Motion.fcfx|Motion}}
{{Fcfile|Motion.fcfx|Motion}}


==Downloadable macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
 
 
 
 
 
 
 
==Macro reference==
 
===RegisterTarget===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RegisterTarget'''
| width="90%" class="mtx-class-macrohead" | '''RegisterTarget'''
|-
|-
| colspan="2" | 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.  
| colspan="2" | 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.  
Line 80: Line 121:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetAcceleration===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAcceleration'''
| width="90%" class="mtx-class-macrohead" | '''SetAcceleration'''
|-
|-
| colspan="2" | 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. 
| colspan="2" | 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. 
Line 103: Line 145:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetSpeed===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSpeed'''
| width="90%" class="mtx-class-macrohead" | '''SetSpeed'''
|-
|-
| colspan="2" | 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 
| colspan="2" | 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 
Line 126: Line 169:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===UnregisterAll===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UnregisterTarget'''
| width="90%" class="mtx-class-macrohead" | '''UnregisterAll'''
|-
|-
| colspan="2" | Remove a target from the list of links. 
| colspan="2" | Totally clear the list of registered objects 
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Target
|-
| colspan="2" | Handle of the object to remove 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 144: Line 183:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===UnregisterTarget===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''UnregisterTarget'''
|-
| colspan="2" | Remove a target from the list of links. 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UnregisterAll'''
|-
|-
| colspan="2" | Totally clear the list of registered objects 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Target
|-
|-
| colspan="2" | Handle of the object to remove 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 176: Line 219:
|-
|-
| colspan="2" | 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.  
| colspan="2" | 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.  
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|}
|}

Latest revision as of 14:23, 13 July 2026

Author Matrix Ltd
Version 1.1
Category Misc


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.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Motion_Helper.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Motion_Helper.fcfx

Detailed description

No detailed description exists yet for this component

Examples

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






Macro reference

RegisterTarget

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.  
- 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) 
- VOID Return


SetAcceleration

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. 
- HANDLE Target
Handle of the object to set the acceleration for. 
- FLOAT Acceleration
Time in milliseconds to reach a new speed. 
- VOID Return


SetSpeed

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 
- HANDLE Target
Target object to set the speed for. 
- FLOAT Speed
Target speed. World units per second or degrees per second. 
- VOID Return


UnregisterAll

UnregisterAll
Totally clear the list of registered objects 
- VOID Return


UnregisterTarget

UnregisterTarget
Remove a target from the list of links. 
- HANDLE Target
Handle of the object to remove 
- VOID Return


Property reference

Properties
Frame Interval
Time interval between animation frames. Does not affect the speed of motion, only the rate of screen updates. 
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.