@novorender/web_app / BaseController
Class: abstract
BaseController
Base class for all camera controllers.
Extended by
Accessors
axes
get axes(): ControllerAxes
The input axes
See
Returns
Defined in
@novorender/web_app/controller/base.ts:55
currentFlyTo
get currentFlyTo(): undefined | Orientation
The current fly-to state, if any.
Returns
undefined
| Orientation
Defined in
@novorender/web_app/controller/base.ts:109
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
Defined in
@novorender/web_app/controller/base.ts:29
hasShift
get hasShift(): boolean
The input shift button state.
See
Returns
boolean
Defined in
@novorender/web_app/controller/base.ts:104
height
get height(): number
The input element height.
See
Returns
number
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
Defined in
@novorender/web_app/controller/base.ts:62
multiplier
get multiplier(): number
The input multiplier.
See
Returns
number
Defined in
@novorender/web_app/controller/base.ts:83
pointerTable
get pointerTable(): readonly TouchContactPoint[]
The input pointer table.
See
Returns
readonly TouchContactPoint
[]
Defined in
@novorender/web_app/controller/base.ts:97
width
get width(): number
The input element width.
See
Returns
number
Defined in
@novorender/web_app/controller/base.ts:69
zoomPos
get zoomPos(): number[]
The input zoom position.
See
Returns
number
[]
Defined in
@novorender/web_app/controller/base.ts:90
Constructors
new BaseController()
protected new BaseController(input): BaseController
Parameters
Parameter | Type | Description |
---|---|---|
input | ControllerInput | The input source for this controller. |
Returns
Defined in
@novorender/web_app/controller/base.ts:46
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.
Defined in
@novorender/web_app/controller/base.ts:136
attach()
attach(): void
Attach this controller to the input object
Returns
void
Defined in
@novorender/web_app/controller/base.ts:193
autoFit()
abstract 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
Defined in
@novorender/web_app/controller/base.ts:179
changed()
protected changed(): void
Signal changes to internal state.
Returns
void
Defined in
@novorender/web_app/controller/base.ts:34
init()
abstract init(params): void
Initialize controller from parameters.
Parameters
Parameter | Type |
---|---|
params | ControllerInitParams |
Returns
void
See
Defined in
@novorender/web_app/controller/base.ts:173
mouseButtonChanged()
mouseButtonChanged(event): void | Promise<void>
Handler for mouse buttons events.
Parameters
Parameter | Type |
---|---|
event | MouseEvent |
Returns
void
| Promise
<void
>
Defined in
@novorender/web_app/controller/base.ts:201
moveBegin()
moveBegin(event): void | Promise<void>
Handler for mouse/touch move events.