Camera
Camera class
Constructor Summary
| Public Constructor | ||
| public |
constructor |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
bindXAngle: float |
|
| public |
bindYAngle: float |
|
| public |
distance: float |
|
| public |
|
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
bind(dhObject: DH3DObject): void bind camera to object |
|
| public |
changeCoordination(): void change coordination |
|
| public |
frustum(left: float, right: float, bottom: float, top: float, nearVal: float, farVal: float): void |
|
| public |
getAnimating(): bool get animation state |
|
| public |
getAnimationTime(): float get animation time (sec) |
|
| public |
getLoop(): bool get loop state |
|
| public |
get motion of object |
|
| public |
get normal matrix |
|
| public |
get position array for WebGL |
|
| public |
get projection array for WebGL |
|
| public |
get projection matrix |
|
| public |
getScreenPosition(pos: Vector3): Vector3 get screen position from world position |
|
| public |
get view array for WebGL |
|
| public |
identity(): void reset camera position and matrix |
|
| public |
lookat(eyeX: float, eyeY: float, eyeZ: float, centerX: float, centerY: float, centerZ: float, upX: float, upY: float, upZ: float): void change camera matrix to look at the given point |
|
| public |
ortho(left: float, right: float, bottom: float, top: float, nearVal: float, farVal: float): void |
|
| public |
perspective(fovy: float, aspect: float, nearVal: float, farVal: float): void |
|
| public |
rotate(angle: float, x: float, y: float, z: float): void rotate camera |
|
| public |
scale(x: float, y: float, z: float): void scale view matrix: zoom up/down |
|
| public |
scaleProjection(x: float, y: float, z: float): void scale projection matrix |
|
| public |
setAnimating(animating: bool): void set animation |
|
| public |
setAnimationTime(time: float): void set animation time (sec) |
|
| public |
setAnimator(animator: Animator): void set animator to object |
|
| public |
setBindOffset(x: float, y: float, z: float): void set offset between camera and binded object |
|
| public |
setLoop(loop: bool): void set animation loop |
|
| public |
set motion to object |
|
| public |
setPosition(x: float, y: float, z: float): void set camera position |
|
| public |
showCameraMatrix(): void show camera matrix for debug |
|
| public |
translate(x: float, y: float, z: float): void move camera position |
|
| public |
unbind(): void unbind object |
|
| public |
update(elapsedTime: float): void update camera position and matrix |
|
Public Constructors
Public Members
public bindObj: DH3DObject source
public bindXAngle: float source
public bindYAngle: float source
public distance: float source
Public Methods
public bind(dhObject: DH3DObject): void source
bind camera to object
Params:
| Name | Type | Attribute | Description |
| dhObject | DH3DObject |
Return:
| void |
public frustum(left: float, right: float, bottom: float, top: float, nearVal: float, farVal: float): void source
Params:
| Name | Type | Attribute | Description |
| left | float | ||
| right | float | ||
| bottom | float | ||
| top | float | ||
| nearVal | float | ||
| farVal | float |
Return:
| void |
public getScreenPosition(pos: Vector3): Vector3 source
get screen position from world position
Params:
| Name | Type | Attribute | Description |
| pos | Vector3 | world position |
public lookat(eyeX: float, eyeY: float, eyeZ: float, centerX: float, centerY: float, centerZ: float, upX: float, upY: float, upZ: float): void source
change camera matrix to look at the given point
Params:
| Name | Type | Attribute | Description |
| eyeX | float | ||
| eyeY | float | ||
| eyeZ | float | ||
| centerX | float | ||
| centerY | float | ||
| centerZ | float | ||
| upX | float | ||
| upY | float | ||
| upZ | float |
Return:
| void |
public ortho(left: float, right: float, bottom: float, top: float, nearVal: float, farVal: float): void source
Params:
| Name | Type | Attribute | Description |
| left | float | ||
| right | float | ||
| bottom | float | ||
| top | float | ||
| nearVal | float | ||
| farVal | float |
Return:
| void |
public perspective(fovy: float, aspect: float, nearVal: float, farVal: float): void source
Params:
| Name | Type | Attribute | Description |
| fovy | float | ||
| aspect | float | ||
| nearVal | float | ||
| farVal | float |
Return:
| void |
public rotate(angle: float, x: float, y: float, z: float): void source
rotate camera
Params:
| Name | Type | Attribute | Description |
| angle | float | rotation angle in radian |
|
| x | float | x value of axis of rotation |
|
| y | float | y value of axis of rotation |
|
| z | float | z value of axis of rotation |
Return:
| void |
public scale(x: float, y: float, z: float): void source
scale view matrix: zoom up/down
Params:
| Name | Type | Attribute | Description |
| x | float | x value of scale |
|
| y | float | y value of scale |
|
| z | float | z value of scale |
Return:
| void |
public scaleProjection(x: float, y: float, z: float): void source
scale projection matrix
Params:
| Name | Type | Attribute | Description |
| x | float | x value of scale |
|
| y | float | y value of scale |
|
| z | float | z value of scale |
Return:
| void |
public setAnimating(animating: bool): void source
set animation
Params:
| Name | Type | Attribute | Description |
| animating | bool |
Return:
| void |
public setAnimationTime(time: float): void source
set animation time (sec)
Params:
| Name | Type | Attribute | Description |
| time | float | animation time |
Return:
| void |
public setAnimator(animator: Animator): void source
set animator to object
Params:
| Name | Type | Attribute | Description |
| animator | Animator |
Return:
| void |
public setBindOffset(x: float, y: float, z: float): void source
set offset between camera and binded object
Params:
| Name | Type | Attribute | Description |
| x | float | ||
| y | float | ||
| z | float |
Return:
| void |
public setLoop(loop: bool): void source
set animation loop
Params:
| Name | Type | Attribute | Description |
| loop | bool |
Return:
| void |
public setMotion(motion: Motion): void source
set motion to object
Params:
| Name | Type | Attribute | Description |
| motion | Motion |
Return:
| void |
public setPosition(x: float, y: float, z: float): void source
set camera position
Params:
| Name | Type | Attribute | Description |
| x | float | x position of camera |
|
| y | float | y position of camera |
|
| z | float | z position of camera |
Return:
| void |
public translate(x: float, y: float, z: float): void source
move camera position
Params:
| Name | Type | Attribute | Description |
| x | float | x value of camera transition |
|
| y | float | y value of camera transition |
|
| z | float | z value of camera transition |
Return:
| void |
public update(elapsedTime: float): void source
update camera position and matrix
Params:
| Name | Type | Attribute | Description |
| elapsedTime | float | elapsedTime |
Return:
| void |