Heilan X3D Browser

GestureDetector

Type

ChildNode.

Description

A basic gesture detector, used to detect clockwise and anti-clockwise circles, upside-down v shapes, and sharp jerks to the left and the right.

Attributes

accelX SFFloat (input/output) The current x-axis value of the accelerometer input, used to detect the known gestures, and passed on as an output.

accelY SFFloat (input/output) The current y-axis value of the accelerometer input, used to detect the known gestures, and passed on as an output.

accelZ SFFloat (input/output) The current z-axis value of the accelerometer input, used to detect the known gestures, and passed on as an output.

debugVisuals SFBool (input) Shows the current state of the detector.

useParticles SFBool (input) When a gesture is detected, visualise it as a trail of particles.

match_1 SFBool (output) Sends true when an anti-clockwise circle (around the z-axis) is detected.

match_2 SFBool (output) Sends true when an clockwise circle (around the z-axis) is detected.

match_3 SFBool (output) Sends true when an upside-down v (along the x-y plane) is detected.

leftJerk SFBool (output) Sends true when a jerk towards the left is detected.

rightJerk SFBool (output) Sends true when a jerk towards the right is detected.

Example Use


<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE X3D>
<X3D profile='Full'>
	<Scene>
		<NavigationInfo type='ANY' headlight='FALSE'/>

		<Ashitaka2 DEF='bob'/>
		<Billboard>
			<GestureDetector DEF='gertrude' useParticles='true'/>
		</Billboard>

		<ROUTE fromNode='gertrude' fromField='match_1' toNode='bob' toField='split1'/>
		<ROUTE fromNode='gertrude' fromField='match_2' toNode='bob' toField='split2'/>
		<ROUTE fromNode='gertrude' fromField='match_3' toNode='bob' toField='split3'/>
		<ROUTE fromNode='gertrude' fromField='leftJerk' toNode='bob' toField='rotateRight'/>
		<ROUTE fromNode='gertrude' fromField='rightJerk' toNode='bob' toField='rotateLeft'/>

		<ROUTE fromNode='gertrude' fromField='accelX' toNode='bob' toField='accelX'/>
		<ROUTE fromNode='gertrude' fromField='accelY' toNode='bob' toField='accelY'/>
		<ROUTE fromNode='gertrude' fromField='accelZ' toNode='bob' toField='accelZ'/>
	</Scene>
</X3D>