Enumeration CameraControllerMode

The CameraControllerMode enumeration tells how user input are processed to move the camera.

The CameraManagerInterface have several ways to process user inputs and deduce a camera position and orientation from them. This enum governs the way the camera is changed according to these user inputs.


3D Rendering

See

CameraManagerInterface

Enumeration Members

CCM_EXAMINE: 1

Examine mode.

Very similar to the Orbit mode but follows a metaphor more akin to the one used in a popular 3D CAD Design tool. It may feel more natural than the orbit mode to CAD designers.

CCM_FLY: 3

Fly mode.

This mode operates like a quake-like game controller. The mouse control the orientation of the view and the position will be changed with keyboard, gamepad or with auto translation on camera direction.

CCM_NONE: 2

None mode.

This mode disables the camera manager i.e. no input like mouse, keyboard or touch event changes the camera location and orientation.

CCM_ORBIT: 0

Orbit mode.

This mode operates with a center of interest, the camera rotates in a sphere around this center of interest. Rolling is not permitted. The end-user can move the camera around its center of interest, zoom in or out, change the center of interest and pan.

CCM_XR: 4

(WebXR) XR mode.

This mode operates automatically when an XR session is started, and cannot be changed till the WebXR session is stopped.

/** 
* Sample to illustrate using a webxr session.
*/
import { InfiniteEngineInterface, InfiniteEngineInterfaceSignal, InfiniteEvent, InfiniteXRSession, CameraManagerInterfaceSignal, InfiniteXRReferenceSpace } from 'generated/documentation/appinfiniteapi';

// We try to make a screenshot when all data is loaded

// created previously the 3D engine
let lInfiniteEngine: InfiniteEngineInterface;
// the webXR session
let lCurSession : InfiniteXRSession;

// store the XRSession when ready
lInfiniteEngine.addEventListener(
InfiniteEngineInterfaceSignal.XRSessionReady,
(pEvent: InfiniteEvent) : void =>
{
lCurSession = pEvent.attachments;
}
);

// make some fancy things on camera changes
// we may have used InfiniteEngineInterfaceSignal.DisplayDone
// to be called each frame
lInfiniteEngine.getCameraManager().addEventListener(
CameraManagerInterfaceSignal.CameraLocationChanged,
(_pEvent: InfiniteEvent) : void =>
{
if (!lCurSession)
{
return;
}
const lXRRefSpace : InfiniteXRReferenceSpace | undefined = lInfiniteEngine.getCameraManager().getXRReferenceFrame();
if (!lXRRefSpace)
{
return;
}
// make some computations with XRSession inputs
console.log(lCurSession.inputSources.length);
}
);

// bind the 3D rendering to the div (should have been done earlier :) )
lInfiniteEngine.setView(undefined, { type: 'webxr', options: {} });

Please see [setView](../interfaces/InfiniteEngineInterface.html#setView).