@novorender/web_app / 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
Accessors
axes
get axes(): ControllerAxes
The input axes
See
Returns
Inherited from
Defined in
@novorender/web_app/controller/base.ts:55
currentFlyTo
get currentFlyTo(): undefined | Orientation
The current fly-to state, if any.
Returns
undefined
| Orientation
Inherited from
Defined in
@novorender/web_app/controller/base.ts:109
fov
get fov(): number
The camera vertical field of view angle, in meters.
set fov(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
Defined in
@novorender/web_app/controller/ortho.ts:82
generation
get generation(): number
Camera controller state generation.
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.
Returns
number
Inherited from
Defined in
@novorender/web_app/controller/base.ts:29
hasShift
get hasShift(): boolean
The input shift button state.
See
Returns
boolean
Inherited from
Defined in
@novorender/web_app/controller/base.ts:104
height
get height(): number
The input element height.
See
Returns
number
Inherited from
Defined in
@novorender/web_app/controller/base.ts:76
moving
get moving(): boolean
Whether the camera is currently considered moving or not.
See
View.isIdleFrame
Returns
boolean
Inherited from
Defined in
@novorender/web_app/controller/base.ts:62
multiplier
get multiplier(): number
The input multiplier.
See
Returns
number
Inherited from
Defined in
@novorender/web_app/controller/base.ts:83
pitch
get pitch(): number
The camera pitch angle, in degrees.
set pitch(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
Defined in
@novorender/web_app/controller/ortho.ts:55
pointerTable
get pointerTable(): readonly TouchContactPoint[]
The input pointer table.
See
Returns
readonly TouchContactPoint
[]
Inherited from
Defined in
@novorender/web_app/controller/base.ts:97
position
get position(): ReadonlyVec3
Camera position, in world space.
set position(value): void
Parameters
Parameter | Type |
---|---|
value | ReadonlyVec3 |
Returns
ReadonlyVec3
Defined in
@novorender/web_app/controller/ortho.ts:38
roll
get roll(): number
The camera roll angle, in degrees.
set roll(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
Defined in
@novorender/web_app/controller/ortho.ts:73
rotation
get rotation(): ReadonlyQuat
Computed rotation quaternion, in world space.
Remarks
This rotation is derived from pitch, yaw and roll angles.
Returns
ReadonlyQuat
Defined in
@novorender/web_app/controller/ortho.ts:50
width
get width(): number
The input element width.
See
Returns
number
Inherited from
Defined in
@novorender/web_app/controller/base.ts:69
yaw
get yaw(): number
The camera yaw angle, in degrees.
set yaw(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
Defined in
@novorender/web_app/controller/ortho.ts:64
zoomPos
get zoomPos(): number[]
The input zoom position.
See
Returns
number
[]
Inherited from
Defined in
@novorender/web_app/controller/base.ts:90
Constructors
new OrthoController()
new OrthoController(input): OrthoController
Parameters
Parameter | Type | Description |
---|---|---|
input | ControllerInput | The input source. |
Returns
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:33
Methods
animate()
animate(elapsedTime): void
Apply time sensitive changes to controller state.
Parameters
Parameter | Type | Description |
---|---|---|
elapsedTime | number | The # of milliseconds elapsed since the last update. |
Returns
void
Remarks
Fly-to animations happens here, as well as motion based on keyboard pressed-state, such as the WASD keys.
Inherited from
Defined in
@novorender/web_app/controller/base.ts:136
attach()
attach(): void
Attach this controller to the input object
Returns
void
Inherited from
Defined in
@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
Parameter | Type | Description |
---|---|---|
center | ReadonlyVec3 | The center of the bounding sphere, in world space. |
radius | number | The radius of the bounding sphere, in world space. |
Returns
void
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:125
changed()
protected changed(): void
Signal changes to internal state.
Returns
void
Inherited from
Defined in
@novorender/web_app/controller/base.ts:34
init()
init(params): void
Initialize controller from parameters.
Parameters
Parameter | Type |
---|---|
params | ControllerInitParams |
Returns
void
See
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:106
mouseButtonChanged()
mouseButtonChanged(event): Promise<void>
Handler for mouse buttons events.
Parameters
Parameter | Type |
---|---|
event | MouseEvent |
Returns
Promise
<void
>
Overrides
BaseController
.mouseButtonChanged
Defined in
@novorender/web_app/controller/ortho.ts:155
moveBegin()
moveBegin(event): void | Promise<void>
Handler for mouse/touch move events.
Parameters
Parameter | Type |
---|---|
event | MouseEvent | TouchEvent |
Returns
void
| Promise
<void
>
Inherited from
Defined in
@novorender/web_app/controller/base.ts:213
moveTo()
moveTo(
targetPosition,
flyTime,
rotation?,
easeFunction?): void
Move controller to specified position/rotation.
Parameters
Parameter | Type | Default value |
---|---|---|
targetPosition | ReadonlyVec3 | undefined |
flyTime | number | 1000 |
rotation ? | ReadonlyQuat | undefined |
easeFunction ? | (t ) => number | undefined |
Returns
void
Overrides
Defined in
@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
Parameter | Type | Description |
---|---|---|
state | RenderStateCamera | The baseline render state. |
elapsedTime | number | The time elapsed since last call, in milliseconds. |
Returns
undefined
| RecursivePartial
<RenderState
>
Inherited from
BaseController
.renderStateChanges
Defined in
@novorender/web_app/controller/base.ts:236
resetFlyTo()
protected resetFlyTo(): void
Returns
void
Inherited from
Defined in
@novorender/web_app/controller/base.ts:113
serialize()
serialize(): ControllerInitParams
Serialize the state of this controller into init parameters.
Returns
See
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:100
setFlyTo()
protected setFlyTo(flyTo): void
Initialize a fly-to transition.
Parameters
Parameter | Type | Description |
---|---|---|
flyTo | FlyToParams | The transition parameters |
Returns
void
Inherited from
Defined in
@novorender/web_app/controller/base.ts:120
stateChanges()
stateChanges(state?): Partial<RenderStateCamera>
Retrieve changes to render state from derived class, if any.
Parameters
Parameter | Type | Description |
---|---|---|
state ? | RenderStateCamera | The baseline state to apply changes to. |
Returns
Partial
<RenderStateCamera
>
See
Remarks
If there are no changes, the returned object will be empty, i.e. .
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:251
touchChanged()
touchChanged(event): void
Handler for touch events.
Parameters
Parameter | Type |
---|---|
event | TouchEvent |
Returns
void
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:146
update()
update(): void
Update internal controller state
Returns
void
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:210
updateParams()
updateParams(params): void
Update controller parameters.
Parameters
Parameter | Type | Description |
---|---|---|
params | Partial <OrthoControllerParams > | Set of parameters to change. |
Returns
void
Defined in
@novorender/web_app/controller/ortho.ts:93
zoomTo()
zoomTo(boundingSphere, flyTime): void
Bring the specified bounding sphere into view.
Parameters
Parameter | Type | Default value |
---|---|---|
boundingSphere | BoundingSphere | undefined |
flyTime | number | 1000 |
Returns
void
Remarks
This function will retain the current camera controller rotation.
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:191
assert()
static assert(controller): asserts controller is OrthoController
OrthoController type assert function.
Parameters
Parameter | Type | Description |
---|---|---|
controller | BaseController | The controller to type assert. |
Returns
asserts controller is OrthoController
Defined in
@novorender/web_app/controller/ortho.ts:283
getDistanceFromViewPlane()
protected static getDistanceFromViewPlane(
point,
cameraPosition,
cameraRotation): number
Compute the distance to a point from the specified view plane.
Parameters
Parameter | Type | Description |
---|---|---|
point | ReadonlyVec3 | The point to measure distance too |
cameraPosition | ReadonlyVec3 | The position of the camera/view plane. |
cameraRotation | ReadonlyQuat | The 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
Defined in
@novorender/web_app/controller/base.ts:262
is()
static is(controller): controller is OrthoController
OrthoController type guard function.
Parameters
Parameter | Type | Description |
---|---|---|
controller | BaseController | The controller to type guard. |
Returns
controller is OrthoController
Defined in
@novorender/web_app/controller/ortho.ts:276
Properties
input
readonly input: ControllerInput;
The input source for this controller.
Inherited from
Defined in
@novorender/web_app/controller/base.ts:48
kind
kind: "ortho";
The controller type id.
Overrides
Defined in
@novorender/web_app/controller/ortho.ts:16
projection
projection: "orthographic";
The camera projection kind.