Skip to main content

@novorender/api / SpecialFlightController

Class: SpecialFlightController

Defined in: @novorender/src/web_app/controller/flight.ts:791

Vassbakk's super special flight controller.

Extends​

Accessors​

axes​

Get Signature​

get axes(): ControllerAxes;

Defined in: @novorender/src/web_app/controller/base.ts:59

The input axes

See​

ControllerInput.axes

Returns​

ControllerAxes

Inherited from​

FlightController.axes


currentFlyTo​

Get Signature​

get currentFlyTo(): undefined | Orientation;

Defined in: @novorender/src/web_app/controller/base.ts:113

The current fly-to state, if any.

Returns​

undefined | Orientation

Inherited from​

FlightController.currentFlyTo


fov​

Get Signature​

get fov(): number;

Defined in: @novorender/src/web_app/controller/flight.ts:124

The camera vertical field of view angle, in degrees.

Returns​

number

Set Signature​

set fov(value): void;

Defined in: @novorender/src/web_app/controller/flight.ts:127

Parameters​
ParameterType
valuenumber
Returns​

void

Inherited from​

FlightController.fov


generation​

Get Signature​

get generation(): number;

Defined in: @novorender/src/web_app/controller/base.ts:34

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​

FlightController.generation


hasShift​

Get Signature​

get hasShift(): boolean;

Defined in: @novorender/src/web_app/controller/base.ts:108

The input shift button state.

See​

ControllerInput.hasShift

Returns​

boolean

Inherited from​

FlightController.hasShift


height​

Get Signature​

get height(): number;

Defined in: @novorender/src/web_app/controller/base.ts:80

The input element height.

See​

ControllerInput.height

Returns​

number

Inherited from​

FlightController.height


moving​

Get Signature​

get moving(): boolean;

Defined in: @novorender/src/web_app/controller/base.ts:66

Whether the camera is currently considered moving or not.

See​

View.isIdleFrame

Returns​

boolean

Inherited from​

FlightController.moving


multiplier​

Get Signature​

get multiplier(): number;

Defined in: @novorender/src/web_app/controller/base.ts:87

The input multiplier.

See​

ControllerInput.multiplier

Returns​

number

Inherited from​

FlightController.multiplier


pitch​

Get Signature​

get pitch(): number;

Defined in: @novorender/src/web_app/controller/flight.ts:106

The camera pitch angle, in degrees.

Returns​

number

Set Signature​

set pitch(value): void;

Defined in: @novorender/src/web_app/controller/flight.ts:109

Parameters​
ParameterType
valuenumber
Returns​

void

Inherited from​

FlightController.pitch


pivot​

Get Signature​

get pivot(): undefined | Pivot;

Defined in: @novorender/src/web_app/controller/flight.ts:133

The optional pivot point to orbit around, in world space.

Returns​

undefined | Pivot

Inherited from​

FlightController.pivot


pointerTable​

Get Signature​

get pointerTable(): readonly TouchContactPoint[];

Defined in: @novorender/src/web_app/controller/base.ts:101

The input pointer table.

See​

ControllerInput.touchPoints

Returns​

readonly TouchContactPoint[]

Inherited from​

FlightController.pointerTable


position​

Get Signature​

get position(): ReadonlyVec3;

Defined in: @novorender/src/web_app/controller/flight.ts:89

Camera position, in world space.

Returns​

ReadonlyVec3

Set Signature​

set position(value): void;

Defined in: @novorender/src/web_app/controller/flight.ts:92

Parameters​
ParameterType
valueReadonlyVec3
Returns​

void

Inherited from​

FlightController.position


rotation​

Get Signature​

get rotation(): ReadonlyQuat;

Defined in: @novorender/src/web_app/controller/flight.ts:101

Computed rotation quaternion, in world space.

Remarks​

This rotation is derived from pitch and yaw angles.

Returns​

ReadonlyQuat

Inherited from​

FlightController.rotation


width​

Get Signature​

get width(): number;

Defined in: @novorender/src/web_app/controller/base.ts:73

The input element width.

See​

ControllerInput.width

Returns​

number

Inherited from​

FlightController.width


yaw​

Get Signature​

get yaw(): number;

Defined in: @novorender/src/web_app/controller/flight.ts:115

The camera yaw angle, in degrees.

Returns​

number

Set Signature​

set yaw(value): void;

Defined in: @novorender/src/web_app/controller/flight.ts:118

Parameters​
ParameterType
valuenumber
Returns​

void

Inherited from​

FlightController.yaw


zoomPos​

Get Signature​

get zoomPos(): number[];

Defined in: @novorender/src/web_app/controller/base.ts:94

The input zoom position.

See​

ControllerInput.zoomPos

Returns​

number[]

Inherited from​

FlightController.zoomPos

Constructors​

Constructor​

new SpecialFlightController(
input,
pick,
conversions,
_params?): SpecialFlightController;

Defined in: @novorender/src/web_app/controller/flight.ts:794

Parameters​

ParameterType
inputControllerInput
pickPickContext
conversionsScreenSpaceConversions
_params?FlightControllerParams

Returns​

SpecialFlightController

Overrides​

FlightController.constructor

Methods​

animate()​

animate(elapsedTime): void;

Defined in: @novorender/src/web_app/controller/base.ts:140

Apply time sensitive changes to controller state.

Parameters​

ParameterTypeDescription
elapsedTimenumberThe # 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​

FlightController.animate


attach()​

attach(): void;

Defined in: @novorender/src/web_app/controller/base.ts:198

Attach this controller to the input object

Returns​

void

Inherited from​

FlightController.attach


autoFit()​

autoFit(center, radius): void;

Defined in: @novorender/src/web_app/controller/flight.ts:171

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

Inherited from​

FlightController.autoFit


changed()​

protected changed(): void;

Defined in: @novorender/src/web_app/controller/base.ts:39

Signal changes to internal state.

Returns​

void

Inherited from​

FlightController.changed


getTransformations()​

getTransformations(): CameraTransformations;

Defined in: @novorender/src/web_app/controller/flight.ts:805

Function to get transformations since last updated. This can be overwritten to easily change direction and scale of input while keeping the standard caluculation for flight controller

Returns​

CameraTransformations

Overrides​

FlightController.getTransformations


init()​

init(params): void;

Defined in: @novorender/src/web_app/controller/flight.ts:154

Initialize controller from parameters.

Parameters​

ParameterType
paramsControllerInitParams

Returns​

void

See​

serialize

Inherited from​

FlightController.init


modifiers()​

protected modifiers(): object;

Defined in: @novorender/src/web_app/controller/flight.ts:557

Function for getting input modifiers based on how far the 3d objects are from the mouse cursor

Returns​

object

mousePanModifier​
mousePanModifier: number;
mouseWheelModifier​
mouseWheelModifier: number;
pinchModifier​
pinchModifier: number;
scale​
scale: number = 20;
touchMovementModifier​
touchMovementModifier: number;

Inherited from​

FlightController.modifiers


mouseButtonChanged()​

mouseButtonChanged(event): Promise<void>;

Defined in: @novorender/src/web_app/controller/flight.ts:408

Handler for mouse buttons events.

Parameters​

ParameterType
eventMouseEvent

Returns​

Promise<void>

Inherited from​

FlightController.mouseButtonChanged


moveBegin()​

moveBegin(event): Promise<void>;

Defined in: @novorender/src/web_app/controller/flight.ts:457

Handler for mouse/touch move events.

Parameters​

ParameterType
eventMouseEvent | TouchEvent

Returns​

Promise<void>

Inherited from​

FlightController.moveBegin


moveTo()​

moveTo(
targetPosition,
flyTime,
rotation?,
easeFunction?): void;

Defined in: @novorender/src/web_app/controller/flight.ts:183

Move controller to specified position/rotation.

Parameters​

ParameterTypeDefault valueDescription
targetPositionReadonlyVec3undefinedThe position to move to, in world space.
flyTimenumber1000The time, in milliseconds, for the transition animation to last, or 0 for instant update. Default should be 1000.
rotation?ReadonlyQuatundefinedOptional target rotation, or undefined to retain current rotation.
easeFunction?(t) => numberundefined-

Returns​

void

Inherited from​

FlightController.moveTo


renderStateChanges()​

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

Defined in: @novorender/src/web_app/controller/base.ts:247

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​

FlightController.renderStateChanges


resetFlyTo()​

protected resetFlyTo(): void;

Defined in: @novorender/src/web_app/controller/base.ts:117

Returns​

void

Inherited from​

FlightController.resetFlyTo


resetVelocity()​

resetVelocity(): void;

Defined in: @novorender/src/web_app/controller/flight.ts:137

Returns​

void

Inherited from​

FlightController.resetVelocity


serialize()​

serialize(): ControllerInitParams;

Defined in: @novorender/src/web_app/controller/flight.ts:148

Serialize the state of this controller into init parameters.

Returns​

ControllerInitParams

See​

init

Inherited from​

FlightController.serialize


setFlyTo()​

protected setFlyTo(flyTo): void;

Defined in: @novorender/src/web_app/controller/base.ts:124

Initialize a fly-to transition.

Parameters​

ParameterTypeDescription
flyToFlyToParamsThe transition parameters

Returns​

void

Inherited from​

FlightController.setFlyTo


stateChanges()​

stateChanges(state?): Partial<RenderStateCamera>;

Defined in: @novorender/src/web_app/controller/flight.ts:384

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

Parameters​

ParameterTypeDescription
state?RenderStateCameraThe baseline state to apply changes to.

Returns​

Partial<RenderStateCamera>

See​

View.modifyRenderState

Remarks​

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

Inherited from​

FlightController.stateChanges


touchChanged()​

touchChanged(event): Promise<void>;

Defined in: @novorender/src/web_app/controller/flight.ts:428

Handler for touch events.

Parameters​

ParameterType
eventTouchEvent

Returns​

Promise<void>

Inherited from​

FlightController.touchChanged


update()​

update(): void;

Defined in: @novorender/src/web_app/controller/flight.ts:271

Update internal controller state

Returns​

void

Inherited from​

FlightController.update


updateParams()​

updateParams(params): void;

Defined in: @novorender/src/web_app/controller/flight.ts:144

Update controller parameters.

Parameters​

ParameterTypeDescription
paramsRecursivePartial<FlightControllerParams>Set of parameters to change.

Returns​

void

Inherited from​

FlightController.updateParams


zoomTo()​

zoomTo(boundingSphere, flyTime): void;

Defined in: @novorender/src/web_app/controller/flight.ts:223

Bring the specified bounding sphere into view.

Parameters​

ParameterTypeDefault valueDescription
boundingSphereBoundingSphereundefinedThe bounding sphere to move into view.
flyTimenumber1000The time, in milliseconds, for the transition animation to last, or 0 for instant update. Default should be 1000.

Returns​

void

Remarks​

This function will retain the current camera controller rotation.

Inherited from​

FlightController.zoomTo


assert()​

static assert(controller): asserts controller is FlightController;

Defined in: @novorender/src/web_app/controller/flight.ts:660

FlightController type assert function.

Parameters​

ParameterTypeDescription
controllerBaseControllerThe controller to type assert.

Returns​

asserts controller is FlightController

Inherited from​

FlightController.assert


getDistanceFromViewPlane()​

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

Defined in: @novorender/src/web_app/controller/base.ts:281

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​

FlightController.getDistanceFromViewPlane


is()​

static is(controller): controller is FlightController;

Defined in: @novorender/src/web_app/controller/flight.ts:653

FlightController type guard function.

Parameters​

ParameterTypeDescription
controllerBaseControllerThe controller to type guard.

Returns​

controller is FlightController

Inherited from​

FlightController.is

Properties​

conversions​

readonly conversions: ScreenSpaceConversions;

Defined in: @novorender/src/web_app/controller/flight.ts:83

Inherited from​

FlightController.conversions


input​

readonly input: ControllerInput;

Defined in: @novorender/src/web_app/controller/base.ts:53

The input source for this controller.

Inherited from​

FlightController.input


kind​

kind: "special";

Defined in: @novorender/src/web_app/controller/flight.ts:792

The controller type id.

Overrides​

FlightController.kind


pick​

readonly pick: PickContext;

Defined in: @novorender/src/web_app/controller/flight.ts:796

The context used for pick queries.

Inherited from​

FlightController.pick


pivotButton​

protected pivotButton: MouseButtons = MouseButtons.right;

Defined in: @novorender/src/web_app/controller/flight.ts:40

Can be overwritten by subclasses to change pivot button

Inherited from​

FlightController.pivotButton


projection​

projection: "pinhole";

Defined in: @novorender/src/web_app/controller/flight.ts:45

The camera projection kind.

See​

RenderStateCamera.kind.

Inherited from​

FlightController.projection