Skip to main content

class.OrthoController

API > OrthoController

Class: OrthoController

The ortho controller is for navigating a orthographic camera.

Remarks

A key aspect of this controller is as a means to view and navigate in 2D, aligning the parallel to the view plane to the axes or some reference plane. The front and back clipping planes are used to reveal a limited slab of the geometry.

Extends

Constructors

constructor

new OrthoController(input): OrthoController

Parameters

ParameterTypeDescription
inputControllerInputThe input source.

Returns

OrthoController

Overrides

BaseController.constructor

Source

@novorender/web_app/controller/ortho.ts:33

Properties

input

readonly input: ControllerInput

The input source for this controller.

Inherited from

BaseController.input

Source

@novorender/web_app/controller/base.ts:48


kind

kind: "ortho"

The controller type id.

Overrides

BaseController.kind

Source

@novorender/web_app/controller/ortho.ts:16


projection

projection: "orthographic"

The camera projection kind.

See

RenderStateCamera.kind.

Overrides

BaseController.projection

Source

@novorender/web_app/controller/ortho.ts:17

Accessors

axes

get axes(): ControllerAxes

The input axes

Returns

ControllerAxes

Inherited from

BaseController.axes

Source

@novorender/web_app/controller/base.ts:55

See

ControllerInput.axes


currentFlyTo

get currentFlyTo(): undefined | Orientation

The current fly-to state, if any.

Returns

undefined | Orientation

Inherited from

BaseController.currentFlyTo

Source

@novorender/web_app/controller/base.ts:109


fov

get set fov(): number

The camera vertical field of view angle, in meters.

Returns

number

Source

@novorender/web_app/controller/ortho.ts:82


generation

get generation(): number

Camera controller state generation.

Returns

number

Inherited from

BaseController.generation

Source

@novorender/web_app/controller/base.ts:29

Remarks

If the controller state changes, the generation count will be incremented once every call to renderStateChanges. This can be used to detect changes by comparing to a local generation count. The count is wrapped at 0xffffffff, so make sure you use != comparison and not < comparison.


hasShift

get hasShift(): boolean

The input shift button state.

Returns

boolean

Inherited from

BaseController.hasShift

Source

@novorender/web_app/controller/base.ts:104

See

ControllerInput.hasShift


height

get height(): number

The input element height.

Returns

number

Inherited from

BaseController.height

Source

@novorender/web_app/controller/base.ts:76

See

ControllerInput.height


moving

get moving(): boolean

Whether the camera is currently considered moving or not.

Returns

boolean

Inherited from

BaseController.moving

Source

@novorender/web_app/controller/base.ts:62

See

View.isIdleFrame


multiplier

get multiplier(): number

The input multiplier.

Returns

number

Inherited from

BaseController.multiplier

Source

@novorender/web_app/controller/base.ts:83

See

ControllerInput.multiplier


pitch

get set pitch(): number

The camera pitch angle, in degrees.

Returns

number

Source

@novorender/web_app/controller/ortho.ts:55


pointerTable

get pointerTable(): readonly TouchContactPoint[]

The input pointer table.

Returns

readonly TouchContactPoint[]

Inherited from

BaseController.pointerTable

Source

@novorender/web_app/controller/base.ts:97

See

ControllerInput.touchPoints


position

get set position(): ReadonlyVec3

Camera position, in world space.

Returns

ReadonlyVec3

Source

@novorender/web_app/controller/ortho.ts:38


roll

get set roll(): number

The camera roll angle, in degrees.

Returns

number

Source

@novorender/web_app/controller/ortho.ts:73


rotation

get rotation(): ReadonlyQuat

Computed rotation quaternion, in world space.

Returns

ReadonlyQuat

Source

@novorender/web_app/controller/ortho.ts:50

Remarks

This rotation is derived from pitch, yaw and roll angles.


width

get width(): number

The input element width.

Returns

number

Inherited from

BaseController.width

Source

@novorender/web_app/controller/base.ts:69

See

ControllerInput.width


yaw

get set yaw(): number

The camera yaw angle, in degrees.

Returns

number

Source

@novorender/web_app/controller/ortho.ts:64


zoomPos

get zoomPos(): number[]

The input zoom position.

Returns

number[]

Inherited from

BaseController.zoomPos

Source

@novorender/web_app/controller/base.ts:90

See

ControllerInput.zoomPos

Methods

animate

animate(elapsedTime): void

Apply time sensitive changes to controller state.

Parameters

ParameterTypeDescription
elapsedTimenumberThe # of milliseconds elapsed since the last update.

Returns

void

Inherited from

BaseController.animate

Source

@novorender/web_app/controller/base.ts:136

Remarks

Fly-to animations happens here, as well as motion based on keyboard pressed-state, such as the WASD keys.


attach

attach(): void

Attach this controller to the input object

Returns

void

Inherited from

BaseController.attach

Source

@novorender/web_app/controller/base.ts:193


autoFit

autoFit(center, radius): void

Attempt to fit controller position such that the specified bounding sphere is brought into view.

Parameters

ParameterTypeDescription
centerReadonlyVec3The center of the bounding sphere, in world space.
radiusnumberThe radius of the bounding sphere, in world space.

Returns

void

Overrides

BaseController.autoFit

Source

@novorender/web_app/controller/ortho.ts:125


changed

protected changed(): void

Signal changes to internal state.

Returns

void

Inherited from

BaseController.changed

Source

@novorender/web_app/controller/base.ts:34


init

init(params): void

Initialize controller from parameters.

Parameters

ParameterType
paramsControllerInitParams

Returns

void

Overrides

BaseController.init

Source

@novorender/web_app/controller/ortho.ts:106

See

serialize


mouseButtonChanged

mouseButtonChanged(event): Promise\< void >

Handler for mouse buttons events.

Parameters

ParameterType
eventMouseEvent

Returns

Promise\< void >

Overrides

BaseController.mouseButtonChanged

Source

@novorender/web_app/controller/ortho.ts:155


moveBegin

moveBegin(event): void | Promise\< void >

Handler for mouse/touch move events.

Parameters

ParameterType
eventMouseEvent | TouchEvent

Returns

void | Promise\< void >

Inherited from

BaseController.moveBegin

Source

@novorender/web_app/controller/base.ts:213


moveTo

moveTo( targetPosition, flyTime = 1000, rotation?, easeFunction?): void

Move controller to specified position/rotation.

Parameters

ParameterTypeDefault value
targetPositionReadonlyVec3undefined
flyTimenumber1000
rotation?ReadonlyQuatundefined
easeFunction?(t) => numberundefined

Returns

void

Overrides

BaseController.moveTo

Source

@novorender/web_app/controller/ortho.ts:164


renderStateChanges

renderStateChanges(state, elapsedTime): undefined | RecursivePartial\< RenderState >

Retrieve the state changes to be applied to the specified render state.

Parameters

ParameterTypeDescription
stateRenderStateCameraThe baseline render state.
elapsedTimenumberThe time elapsed since last call, in milliseconds.

Returns

undefined | RecursivePartial\< RenderState >

Inherited from

BaseController.renderStateChanges

Source

@novorender/web_app/controller/base.ts:236


resetFlyTo

protected resetFlyTo(): void

Returns

void

Inherited from

BaseController.resetFlyTo

Source

@novorender/web_app/controller/base.ts:113


serialize

serialize(): ControllerInitParams

Serialize the state of this controller into init parameters.

Returns

ControllerInitParams

Overrides

BaseController.serialize

Source

@novorender/web_app/controller/ortho.ts:100

See

init


setFlyTo

protected setFlyTo(flyTo): void

Initialize a fly-to transition.

Parameters

ParameterTypeDescription
flyToFlyToParamsThe transition parameters

Returns

void

Inherited from

BaseController.setFlyTo

Source

@novorender/web_app/controller/base.ts:120


stateChanges

stateChanges(state?): Partial\< RenderStateCamera >

Retrieve changes to render state from derived class, if any.

Parameters

ParameterTypeDescription
state?RenderStateCameraThe baseline state to apply changes to.

Returns

Partial\< RenderStateCamera >

Overrides

BaseController.stateChanges

Source

@novorender/web_app/controller/ortho.ts:251

See

View.modifyRenderState

Remarks

If there are no changes, the returned object will be empty, i.e. {}.


touchChanged

touchChanged(event): void

Handler for touch events.

Parameters

ParameterType
eventTouchEvent

Returns

void

Overrides

BaseController.touchChanged

Source

@novorender/web_app/controller/ortho.ts:146


update

update(): void

Update internal controller state

Returns

void

Overrides

BaseController.update

Source

@novorender/web_app/controller/ortho.ts:210


updateParams

updateParams(params): void

Update controller parameters.

Parameters

ParameterTypeDescription
paramsPartial\< OrthoControllerParams >Set of parameters to change.

Returns

void

Source

@novorender/web_app/controller/ortho.ts:93


zoomTo

zoomTo(boundingSphere, flyTime = 1000): void

Bring the specified bounding sphere into view.

Parameters

ParameterTypeDefault value
boundingSphereBoundingSphereundefined
flyTimenumber1000

Returns

void

Overrides

BaseController.zoomTo

Source

@novorender/web_app/controller/ortho.ts:191

Remarks

This function will retain the current camera controller rotation.


assert

static assert(controller): asserts controller is OrthoController

OrthoController type assert function.

Parameters

ParameterTypeDescription
controllerBaseControllerThe controller to type assert.

Returns

asserts controller is OrthoController

Source

@novorender/web_app/controller/ortho.ts:283


getDistanceFromViewPlane

static protected getDistanceFromViewPlane( point, cameraPosition, cameraRotation): number

Compute the distance to a point from the specified view plane.

Parameters

ParameterTypeDescription
pointReadonlyVec3The point to measure distance too
cameraPositionReadonlyVec3The position of the camera/view plane.
cameraRotationReadonlyQuatThe rotation of the camera/view plane.

Returns

number

A signed distance from the point to the view plane, i.e. positive for points in front of the plane and negative otherwise.

Inherited from

BaseController.getDistanceFromViewPlane

Source

@novorender/web_app/controller/base.ts:262


is

static is(controller): controller is OrthoController

OrthoController type guard function.

Parameters

ParameterTypeDescription
controllerBaseControllerThe controller to type guard.

Returns

controller is OrthoController

Source

@novorender/web_app/controller/ortho.ts:276