跳到主要内容
版本:v10.0

M3D / M3D / Inputs / WalkthroughCameraInputHandler

Class: WalkthroughCameraInputHandler

M3D.Inputs.WalkthroughCameraInputHandler

Memberof

M3D.Inputs

Description

漫游相机输入

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new WalkthroughCameraInputHandler(input): WalkthroughCameraInputHandler

Parameters

NameType
inputInput

Returns

WalkthroughCameraInputHandler

Description

构造函数

Overrides

CommonCameraInputHandler.constructor

Properties

id

id: number

Inherited from

CommonCameraInputHandler.id


count

Static count: number

Inherited from

CommonCameraInputHandler.count


customHandlerConfig

Static customHandlerConfig: Map<string, any>

Inherited from

CommonCameraInputHandler.customHandlerConfig

Methods

KeyUp

KeyUp(e): void

Parameters

NameType
eKeyEventArgs

Returns

void

Description

键盘抬起事件


MoveSideways

MoveSideways(distance): void

Parameters

NameType
distancenumber

Returns

void

Description

左右移动


MoveUpAndDown

MoveUpAndDown(distance): void

Parameters

NameType
distancenumber

Returns

void

Description

上下移动


RotateSideways

RotateSideways(degree): void

Parameters

NameType
degreenumber

Returns

void

Description

左右旋转


getCamera

getCamera(): Camera

Returns

Camera

相机

Description

获取相机

Inherited from

CommonCameraInputHandler.getCamera


getCameraFov

getCameraFov(): number

Returns

number

Description

获取透视投影中的fov角度值


getCameraRotateMode

getCameraRotateMode(): CameraRotateMode

Returns

CameraRotateMode

Description

获取摄像机旋转方式

Inherited from

CommonCameraInputHandler.getCameraRotateMode


getControlLockXY

getControlLockXY(): boolean

Returns

boolean

Description

获取是否约束观察

Inherited from

CommonCameraInputHandler.getControlLockXY


getDirectionDistance

getDirectionDistance(direction, mark): number

Parameters

NameType
directionVector3
marknumber

Returns

number

Description

只有摄像机在内部时才使用,粗略计算摄像机方向距离,通过与传入的mark代表的世界坐标系来指定;如果需要精确获得需要真正计算与包围盒交点来指定的。返回的是距离


getEvents

getEvents(): M3DEvent[]

Returns

M3DEvent[]

Description

获得事件列表

Inherited from

CommonCameraInputHandler.getEvents


getFreeViewMode

getFreeViewMode(): boolean

Returns

boolean

Description

获取是否自由观察

Inherited from

CommonCameraInputHandler.getFreeViewMode


getId

getId(): number

Returns

number

Description

获取id

Inherited from

CommonCameraInputHandler.getId


getInput

getInput(): Input

Returns

Input

Description

获取Input

Inherited from

CommonCameraInputHandler.getInput


getOribitMode

getOribitMode(): boolean

Returns

boolean

Description

获取是否动态观察

Inherited from

CommonCameraInputHandler.getOribitMode


getRotateCenterPoint

getRotateCenterPoint(): ImagePoint

Returns

ImagePoint

旋转中心

Description

获取旋转中心

Inherited from

CommonCameraInputHandler.getRotateCenterPoint


getScene

getScene(): Scene

Returns

Scene

场景

Description

获取场景

Inherited from

CommonCameraInputHandler.getScene


getTrackBall

getTrackBall(): TrackBall

Returns

TrackBall

轨迹球

Description

获取轨迹球

Inherited from

CommonCameraInputHandler.getTrackBall


getTrackball

getTrackball(): TrackBall

Returns

TrackBall

轨迹球

Description

获取追踪球

Inherited from

CommonCameraInputHandler.getTrackball


getUpDirection

getUpDirection(): Vector3

Returns

Vector3

向上方向

Description

获取向上方向

Inherited from

CommonCameraInputHandler.getUpDirection


getViewMode

getViewMode(): ViewMode

Returns

ViewMode

Description

获取观察模式

Inherited from

CommonCameraInputHandler.getViewMode


initCamera

initCamera(): void

Returns

void

Description

初始化摄像要状态。设置透视投影模式等


initYawPitchRoll

initYawPitchRoll(): void

Returns

void

Description

根据摄像机状态初始化偏航角、俯仰角、滚转角

Inherited from

CommonCameraInputHandler.initYawPitchRoll


keepRotateTaskFunction

keepRotateTaskFunction(that): void

Parameters

NameType
thatany

Returns

void

Description

设置持续旋转

Inherited from

CommonCameraInputHandler.keepRotateTaskFunction


keyDown

keyDown(e): void

Parameters

NameType
eKeyEventArgs

Returns

void

Description

键盘按下事件

Overrides

CommonCameraInputHandler.keyDown


keyUp

keyUp(event): void

Parameters

NameType
eventInputEventArgs

Returns

void

Description

键盘抬起事件

Inherited from

CommonCameraInputHandler.keyUp


mouseDown

mouseDown(event): void

Parameters

NameType
eventInputEventArgs

Returns

void

Description

鼠标按下事件

Inherited from

CommonCameraInputHandler.mouseDown


mouseMove

mouseMove(event): void

Parameters

NameTypeDescription
eventInputEventArgs输入事件

Returns

void

Description

鼠标移动

Inherited from

CommonCameraInputHandler.mouseMove


mouseUp

mouseUp(event): void

Parameters

NameTypeDescription
eventInputEventArgs输入事件

Returns

void

Description

鼠标抬起

Inherited from

CommonCameraInputHandler.mouseUp


mouseWheel

mouseWheel(event): void

Parameters

NameType
eventInputEventArgs

Returns

void

Description

鼠标滚轮

Inherited from

CommonCameraInputHandler.mouseWheel


moveStraight

moveStraight(distance): void

Parameters

NameType
distancenumber

Returns

void

Description

前后移动


registerEvent

registerEvent(event): void

Parameters

NameTypeDescription
eventM3DEventM3D事件

Returns

void

Description

注册事件

Inherited from

CommonCameraInputHandler.registerEvent


removeEvent

removeEvent(): void

Returns

void

Description

删除事件

Inherited from

CommonCameraInputHandler.removeEvent


reset

reset(): void

Returns

void

Description

重置

Inherited from

CommonCameraInputHandler.reset


setCameraFov

setCameraFov(fov): void

Parameters

NameType
fovnumber

Returns

void

Description

设置透视投影中的fov角度值


setCameraRotateMode

setCameraRotateMode(rotateMode): void

Parameters

NameType
rotateModeCameraRotateMode

Returns

void

Description

设置摄像机旋转方式

Inherited from

CommonCameraInputHandler.setCameraRotateMode


setControlLockXY

setControlLockXY(value): void

Parameters

NameType
valueboolean

Returns

void

Description

设置是否约束观察

Inherited from

CommonCameraInputHandler.setControlLockXY


setFreeViewMode

setFreeViewMode(value): void

Parameters

NameType
valueboolean

Returns

void

Description

设置是否自由观察

Inherited from

CommonCameraInputHandler.setFreeViewMode


setId

setId(v): void

Parameters

NameTypeDescription
vnumberShapeId

Returns

void

Description

设置id

Inherited from

CommonCameraInputHandler.setId


setInput

setInput(i): void

Parameters

NameType
iInput

Returns

void

Description

设置需要处理的Input对象

Inherited from

CommonCameraInputHandler.setInput


setOribitMode

setOribitMode(value): void

Parameters

NameType
valueboolean

Returns

void

Description

设置是否动态观察

Inherited from

CommonCameraInputHandler.setOribitMode


setUpDirection

setUpDirection(upDirection): void

Parameters

NameTypeDescription
upDirectionVector3向上方向

Returns

void

Description

设置地面向上方向

Inherited from

CommonCameraInputHandler.setUpDirection


setViewMode

setViewMode(value): void

Parameters

NameType
valueViewMode

Returns

void

Description

设置观察模式

Inherited from

CommonCameraInputHandler.setViewMode


setYawPitchRollRange

setYawPitchRollRange(pitchRange, yawRange, rollange): void

Parameters

NameType
pitchRangeVector2
yawRangeVector2
rollangeVector2

Returns

void

Description

设置俯仰角(-90度—90度)、偏航角(-180度—180度)、滚转角(-180度—180度)限制

Inherited from

CommonCameraInputHandler.setYawPitchRollRange


stateChanged

stateChanged(): boolean

Returns

boolean

是否需要修改场景

Description

判断是否需要修改场景

Inherited from

CommonCameraInputHandler.stateChanged


touchDown

touchDown(event): void

Parameters

NameType
eventInputEventArgs

Returns

void

Description

触摸按下事件

Inherited from

CommonCameraInputHandler.touchDown


touchMove

touchMove(event): void

Parameters

NameType
eventInputEventArgs

Returns

void

Description

触摸移动事件

Inherited from

CommonCameraInputHandler.touchMove


touchUp

touchUp(event): void

Parameters

NameType
eventInputEventArgs

Returns

void

Description

触摸抬起事件

Inherited from

CommonCameraInputHandler.touchUp


virtualKeyMove

virtualKeyMove(strSpeed, sidSpeed): void

Parameters

NameType
strSpeednumber
sidSpeednumber

Returns

void

Description

虚拟键盘移动


addCustomConfig

addCustomConfig(key, value): void

Parameters

NameTypeDescription
keystringkey值
valueany内容

Returns

void

Description

添加配置

Inherited from

CommonCameraInputHandler.addCustomConfig


getHandler

getHandler(key): any

Parameters

NameTypeDescription
keystringkey值

Returns

any

Description

获取手柄

Inherited from

CommonCameraInputHandler.getHandler


initCustomConfig

initCustomConfig(): void

Returns

void

Description

初始化配置

Inherited from

CommonCameraInputHandler.initCustomConfig