Default values for cameras
Defines the tracking modes available for instances of vxlCamera
A tracking mode is only required when the camera is set to follow an actor using vxlCamera#follow
The tracking modes can be:
DEFAULT: The camera does not follow an actor. Controlled by the user to look around the world.ROTATIONAL: The camera does not move but follows an actor positionTRANSLATIONAL: The camera moves with the actor, the angle is constantCINEMATIC: Similar to ROTATIONAL but allowing camera roll for a more dramatic effect to set the tracking mode of the camera myCamera you should make sure that your camera is of tracking type with: myCamera.setType(vxl.def.camera.type.TRACKING). For instance:
var actor = vxl.api.getActor('cone'); //from the current scene var camera = vxl.c.camera; camera.setType(vxl.def.camera.type.TRACKING); camera.setTrackingMode(vxl.def.camera.tracking.ROTATIONAL); camera.follow(actor);a shorter way would be:
var actor = vxl.api.getActor('cone'); //from the current scene var camera = vxl.c.camera; camera.setType(vxl.def.camera.type.TRACKING); camera.follow(actor, vxl.def.camera.tracking.ROTATIONAL);
The camera type can be:
ORBITING: Orbiting Camera - Around the WorldTRACKING: Tracking Camera - First Person CameraEXPLORING: Camera axes are updated on every rotationThese modes can be used with the vxlCamera constructor or with its setType method