moveForward method

dynamic moveForward(
  1. dynamic distance
)

Implementation

moveForward(distance) {
  // move forward parallel to the xz-plane
  // assumes camera.up is y-up

  _vector.setFromMatrixColumn(camera.matrix, 0);

  _vector.crossVectors(camera.up, _vector);

  camera.position.addScaledVector(_vector, distance);
}