Difference between revisions of "Component: Collision Detector Template (Sensors)"

From Flowcode Help
Jump to navigationJump to search
 
(8 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Collision_Detector.fcfx FC_Comp_Source_Collision_Detector.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Collision_Detector.fcfx FC_Comp_Source_Collision_Detector.fcfx]
 +
 
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Collision_Detector.fcfx FC_Comp_Source_Collision_Detector.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 30: Line 42:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 38: Line 60:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
 
==Macro reference==
 
==Macro reference==
  
 +
===ReadState===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 54: Line 87:
  
  
 +
===SetTarget===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 72: Line 106:
  
  
 +
===WaitUntilHigh===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 85: Line 120:
  
  
 +
===WaitUntilLow===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 96: Line 132:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 13:09, 7 February 2023

Author Matrix Ltd
Version 1.2
Category Sensors


Collision Detector Template component

Polls a chosen panel object to see if it has collided with another object. When collisions happen, a user notification event is generated and a pin is set or reset. Another event is sent when the two objects separate.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

ReadState

Fc9-comp-macro.png ReadState
Get the current collision state. The 'Polarity' property will affect whether a collision is represented by a high or low state. 
Fc9-u8-icon.png - BYTE Return


SetTarget

Fc9-comp-macro.png SetTarget
Set the object that you want to test for collision with. If this is not called, or is called with handle = 0, collisions will be tested against every panel object that has 'Solid' status. NB) Specifying an object will save CPU power!! 
Fc9-h32-icon.png - HANDLE Target
The object to test for collision with. 
Fc9-void-icon.png - VOID Return


WaitUntilHigh

Fc9-comp-macro.png WaitUntilHigh
Pause the program until the detector goes high. 'Polarity' will affect whether high value represents a collision or separation. NB) In simulation, only use this macro if testing for collision with animated or timer driven objects!! 
Fc9-void-icon.png - VOID Return


WaitUntilLow

Fc9-comp-macro.png WaitUntilLow
Pause the program until the detector goes low. 'Polarity' will affect whether low value represents a collision or separation. NB) In simulation, only use this macro if testing for collision with animated or timer driven objects!! 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Pin
The pin that should change state when objects collide or separate. 
Fc9-type-16-icon.png Polarity
Active High = Pin is high when objects collide, low when they are separate. Active Low = Pin is low when objects collide, high when they are separate. 
Fc9-conn-icon.png Simulation
Fc9-type-17-icon.png Test Object
The object to test for collisions. A user event is sent each time this object collides with any other, or when the two object separate. 
Fc9-type-17-icon.png Mouse Object
Choose an object that the user can clock on to simulate a collision when testing. 
Fc9-type-21-icon.png Detector Ident
An ID value to identify this particular detector. Will be sent as the 'Ident' value for the notification events sent out so that multiple detectors can be told apart. 
Fc9-type-21-icon.png Timer Interval (ms)
Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions.