ShootVRControls

ShootVRControls

Makes sure that an given solid in the geometry follows a VR controller (living in the tangent space). The position of the underlying shape should be given by an isometry of the geometry

Constructor

new ShootVRControls(controller, camera, solids, speed)

Source:

Constructor

Parameters:
Name Type Description
controller Group

the group representing the controller

camera VRCamera

the camera (giving the position of the observer)

solids Array.<Solid>

the solid following the controller.

speed number

speed of the bullet The position of the underlying shape should be given by an isometry.

Classes

ShootVRControls

Members

(private) _clock :Clock

Source:

Clock to update the position of the bullets

Type:
  • Clock

(private) _nextBullet :number

Source:

The id of the next solid to shoot

Type:
  • number

(private) _status :number

Source:

Status of the gun

  • STATUS_REST: at rest
  • STATUS_TRIGGERED: the user pressed the button, the the bullet has not been launched
Type:
  • number

Methods

onSelectEnd()

Source:

Event handler when the user stops selecting

onSelectStart()

Source:

Event handler when the user starts selecting

shoot(position)

Source:

Shoot the next bullet

Parameters:
Name Type Description
position Position

initial position of the bullet

update(webXRManager)

Source:
Parameters:
Name Type Description
webXRManager WebXRManager

the WebXRManager used by Three.js

updateAllBullets()

Source:

Update the position of all bullets

updateBullet(index)

Source:

Update the position of the given bullet

Parameters:
Name Type Description
index number

the index of the bullet