Home Reference Source Repository
import DH3DObject from 'dh3dlib/js/base/DH3DObject.js'
public class | source

DH3DObject

DH3DObject basic class

Constructor Summary

Public Constructor
public

constructor

Method Summary

Public Methods
public

addMotionCallback(func: *, time: *, state: *)

public

set callback function for each move

public

animate(elapsedTime: *)

public
public

get animating state

public

get animation speed

public

getAnimationTime(): float

get animation time

public

get Animator object

public
public
public
public

get loop state

public
public

getMirror(): *

public

get Model object

public

get Motion object

public
public

get object position

public
public

get Renderer object

public

get quaternion for rotation

public
public

get object speed

public

getState(): *

public

getTexture(): *

public

move(elapsedTime: float): void

move object

public

removeMotionCallback(func: *, time: *, state: *)

public

remove callback function for each move

public

render()

public

renderMirror(reflectionObjectArray: *)

public

setAnimating(animating: boolean): void

set animating state

public

setAnimationSpeed(speed: float): void

set animation speed

public

setAnimationTime(time: float): void

set animation time

public

setAnimator(animator: Animator): void

set Animator object

public

setAutoDirection(autoDirection: boolean)

public

setDirection(direction: *)

public

setLoop(loop: boolean): void

set loop state

public

setMaxSpeed(maxSpeed: *)

public

setMirror(flag: *)

public

setModel(model: Model): void

set Model object

public

setMotion(motion: Motion): void

set Motion object

public

setMotionWithBlending(motion: Motion, blendCount: float): void

set Motion object to blend with current motion

public

setPosition(x: Vector3 | float, y: float, z: float): void

set object position

public
public

setRenderer(renderer: Renderer): void

set Renderer object

public

setRotate(x: Vector4 | float, y: float, z: float, w: float): void

set quaternion for rotation

public

setRotateAxis(axis: *, rotAngle: *)

public

setScale(x: *, y: *, z: *)

public

setSpeed(x: Vector3 | float, y: float, z: float): void

set object speed

public

setState(state: *)

public

Public Constructors

public constructor source

constructor

Public Methods

public addMotionCallback(func: *, time: *, state: *) source

Params:

NameTypeAttributeDescription
func *
time *
state *

public addMoveCallback(func: Function): number source

set callback function for each move

Params:

NameTypeAttributeDescription
func Function

callback which is called each frame

Return:

number

0: success, -1: failure (func is not function)

public animate(elapsedTime: *) source

Params:

NameTypeAttributeDescription
elapsedTime *

public clearMotionCallback() source

public getAnimating(): boolean source

get animating state

Return:

boolean

true: enable animation, false: disable animation

public getAnimationSpeed(): float source

get animation speed

Return:

float

animation speed: normal speed is 1.0

public getAnimationTime(): float source

get animation time

Return:

float

animation time (seconds)

public getAnimator(): Animator source

get Animator object

Return:

Animator

Animator object

public getAutoDirection(): * source

Return:

*

public getDirection(): * source

Return:

*

public getDynamicSkinArray(): * source

Return:

*

public getLoop(): boolean source

get loop state

Return:

boolean

true: enable loop, false: disable loop

public getMaxSpeed(): * source

Return:

*

public getMirror(): * source

Return:

*

public getModel(): Model source

get Model object

Return:

Model

model object

public getMotion(): Motion source

get Motion object

Return:

Motion

Motion object

public getNumElements(): number source

Return:

number

public getPosition(): Vector3 source

get object position

Return:

Vector3

object position

public getReflectionMode(): * source

Return:

*

public getRenderer(): Renderer source

get Renderer object

Return:

Renderer

Renderer object

public getRotate(): Vector4 source

get quaternion for rotation

Return:

Vector4

quaternion

public getSkinArray(): * source

Return:

*

public getSpeed(): Vector3 source

get object speed

Return:

Vector3

object speed

public getState(): * source

Return:

*

public getTexture(): * source

Return:

*

public move(elapsedTime: float): void source

move object

Params:

NameTypeAttributeDescription
elapsedTime float

elapsed time (seconds) from previous frame

Return:

void

public removeMotionCallback(func: *, time: *, state: *) source

Params:

NameTypeAttributeDescription
func *
time *
state *

public removeMoveCallback(func: Function): number source

remove callback function for each move

Params:

NameTypeAttributeDescription
func Function

callback which is called each frame

Return:

number

0: success, -1: failure (func is not registered)

public render() source

public renderMirror(reflectionObjectArray: *) source

Params:

NameTypeAttributeDescription
reflectionObjectArray *

public setAnimating(animating: boolean): void source

set animating state

Params:

NameTypeAttributeDescription
animating boolean

true: enable animation, false: disable animation

Return:

void

public setAnimationSpeed(speed: float): void source

set animation speed

Params:

NameTypeAttributeDescription
speed float

animation speed: normal speed is 1.0

Return:

void

public setAnimationTime(time: float): void source

set animation time

Params:

NameTypeAttributeDescription
time float

animation time (seconds)

Return:

void

public setAnimator(animator: Animator): void source

set Animator object

Params:

NameTypeAttributeDescription
animator Animator

Animator object

Return:

void

public setAutoDirection(autoDirection: boolean) source

Params:

NameTypeAttributeDescription
autoDirection boolean
  • optional
  • default: true

public setDirection(direction: *) source

Params:

NameTypeAttributeDescription
direction *

public setLoop(loop: boolean): void source

set loop state

Params:

NameTypeAttributeDescription
loop boolean

true: enable loop, false: disable loop

Return:

void

public setMaxSpeed(maxSpeed: *) source

Params:

NameTypeAttributeDescription
maxSpeed *

public setMirror(flag: *) source

Params:

NameTypeAttributeDescription
flag *

public setModel(model: Model): void source

set Model object

Params:

NameTypeAttributeDescription
model Model

Model object. Set null to delete object

Return:

void

public setMotion(motion: Motion): void source

set Motion object

Params:

NameTypeAttributeDescription
motion Motion

Motion object. Set null to delete object

Return:

void

public setMotionWithBlending(motion: Motion, blendCount: float): void source

set Motion object to blend with current motion

Params:

NameTypeAttributeDescription
motion Motion

Motion object to blend

blendCount float

number of frames to complete transition

Return:

void

public setPosition(x: Vector3 | float, y: float, z: float): void source

set object position

Params:

NameTypeAttributeDescription
x Vector3 | float

object position (Vector3 object or X value)

y float

Y value

z float

Z value

Return:

void

public setReflectionMode(flag: *) source

Params:

NameTypeAttributeDescription
flag *

public setRenderer(renderer: Renderer): void source

set Renderer object

Params:

NameTypeAttributeDescription
renderer Renderer

Renderer object

Return:

void

public setRotate(x: Vector4 | float, y: float, z: float, w: float): void source

set quaternion for rotation

Params:

NameTypeAttributeDescription
x Vector4 | float

quaternion (Vector4 or X value)

y float

Y value

z float

Z value

w float

W value

Return:

void

public setRotateAxis(axis: *, rotAngle: *) source

Params:

NameTypeAttributeDescription
axis *
rotAngle *

public setScale(x: *, y: *, z: *) source

Params:

NameTypeAttributeDescription
x *
y *
z *

public setSpeed(x: Vector3 | float, y: float, z: float): void source

set object speed

Params:

NameTypeAttributeDescription
x Vector3 | float

object speed (Vector3 object or X value)

y float

Y value of speed

z float

Z value of speed

Return:

void

public setState(state: *) source

Params:

NameTypeAttributeDescription
state *

public updateMaterial() source