Class: cameraTarget

Player~Player.cameraTarget()

new cameraTarget()

Functions for camera for looking at selected point.
Source:

Methods

changeTarget(mesh, i, optionsopt)

Change target.
Parameters:
Name Type Attributes Description
mesh THREE.Mesh Mech with selected point as target for camera.
i number index of the point.
options Options <optional>
See Options.
Source:

get(optionsopt)

get camera target
Parameters:
Name Type Attributes Description
options Object <optional>
See the options parameter of the MyThree class.
Properties
Name Type Attributes Description
player Object <optional>
Player instance.
Source:

init(cameraTarget, options, boErrorMessageopt)

Create default camera target
Parameters:
Name Type Attributes Default Description
cameraTarget object the following cameraTarget are available:
Properties
Name Type Attributes Default Description
camera THREE.PerspectiveCamera <optional>
PerspectiveCamera
boLook boolean <optional>
false true - camera look at the target.
distanceToCamera THREE.Vector3 <optional>
Distance from target point to camera. You can set the distance to the camera depending on the time.
	Example 1: new THREE.Vector3( 0, 0, new Function( 't', 'return 2+t' ) )
	Example 2: new THREE.Vector3( 0, 0,
		[ { t: 0, v: 5 }, { t: 1, v: 2 }, { t: 10, v: 2 }, { t: 11, v: 5 } ] )
	Default is camera.position.
rotation object <optional>
rotation camera around point specified by an axis and an angle. Default is undefined - no rotation
Properties
Name Type Attributes Default Description
angle number | function | array <optional>
0 Angle of rotation in radians.
  number. Example: Math.PI / 2 rotate to 90 degrees.
  function. Example: new Function( 't', 'return 5*t' ).
  array.
    Example 1: [0, Math.PI]
      0 is angle for t = min is start time of the playing.
      Math.PI is rotate to 180 degrees
        for t = max is time of the stopping of the playing.
      If max time is infinity, then angle is for t = min.
    Example 2: [{ t: 0, v: 0 }, { t: 1, v: Math.PI / 2 }
      t is time,
      v is angle for current t.
axis THREE.Vector3 <optional>
Axis of rotattion.
  Example: new THREE.Vector3( 1, 0, 0 ) - rotate around x axis.
  Default is rotate around y axis
options Object See the options parameter of the MyThree class.
boErrorMessage boolean <optional>
true false - Do not send an error message to the console if cameraTarget.camera is not defined.
Source:

setCameraTarget(options)

Update camera settings.
Parameters:
Name Type Description
options Object See the options parameter of the MyThree class.
Source: