User Tools

Site Tools


api:game_object

GAME_OBJECT

Abstract class
Category: Data

Properties


Position


Scale

  • Type: vec3f
  • Default value: { 1, 1, 1 }

Orientation


Name

  • Type: string

Active

  • Type: boolean

Functions


translate

void translate(translation)

Name Type Description
translation vec3f

move

void move(direction)

Name Type Description
direction vec3f

resetOrientation

void resetOrientation()


lookAt

void lookAt(target [, up [, lockOnUpAxis]])

Name Type Description
target vec3f
up vec3f
lockOnUpAxis boolean

void lookAt(target, lockOnUpAxis)

Name Type Description
target vec3f
lockOnUpAxis boolean

rotateAround

void rotateAround(pivot, rotation)

Name Type Description
pivot vec3f
rotation quaternion

void rotateAround(pivot, vector, angle)

Name Type Description
pivot vec3f
vector vec3f
angle float

rotate

void rotate(quaternion)

Name Type Description
quaternion quaternion

rotateX

void rotateX(ax)

Name Type Description
ax float

rotateY

void rotateY(ay)

Name Type Description
ay float

rotateZ

void rotateZ(az)

Name Type Description
az float

setRotationX

void setRotationX(ax)

Name Type Description
ax float

setRotationY

void setRotationY(ay)

Name Type Description
ay float

setRotationZ

void setRotationZ(az)

Name Type Description
az float

rotateLocal

void rotateLocal(quaternion)

Name Type Description
quaternion quaternion

rotateLocalX

void rotateLocalX(ax)

Name Type Description
ax float

rotateLocalY

void rotateLocalY(ay)

Name Type Description
ay float

rotateLocalZ

void rotateLocalZ(az)

Name Type Description
az float

setScale

void setScale(scale)

Name Type Description
scale float

scale

void scale(scale)

Name Type Description
scale vec3f

void scale(scale)

Name Type Description
scale float

scaleAround

void scaleAround(pivot, scale)

Name Type Description
pivot vec3f
scale vec3f

generateGlobalMatrix

void generateGlobalMatrix(outMatrix)

Name Type Description
outMatrix matrix Out argument

setLocalMatrix

void setLocalMatrix(matrix)

Name Type Description
matrix matrix

setGlobalPosition

void setGlobalPosition(position)

Name Type Description
position vec3f

setGlobalOrientation

void setGlobalOrientation(orientation)

Name Type Description
orientation quaternion

setGlobalTransform

void setGlobalTransform(position, orientation)

Name Type Description
position vec3f
orientation quaternion

void setGlobalTransform(position, orientation, scale)

Name Type Description
position vec3f
orientation quaternion
scale vec3f

setGlobalMatrix

void setGlobalMatrix(matrix)

Name Type Description
matrix matrix

setGlobalMatrixIgnoreScale

void setGlobalMatrixIgnoreScale(matrix)

Name Type Description
matrix matrix

getGlobalPosition

vec3f getGlobalPosition()


getGlobalOrientation

quaternion getGlobalOrientation()


globalLookAt

void globalLookAt(target [, lockOnUpAxis])

Name Type Description
target vec3f
lockOnUpAxis boolean

getLevel

LEVEL getLevel()


destroy

void destroy()


destroyAllChild

void destroyAllChild()


getParent

GAME_OBJECT getParent()


setParent

void setParent(parent [, keepWorldTransform])

Name Type Description
parent GAME_OBJECT
keepWorldTransform boolean

isChildOf

boolean isChildOf(parent)

Name Type Description
parent GAME_OBJECT

forEachChild

void forEachChild(function)

Name Type Description
function function<void(GAME_OBJECT)>

forEachChildRecursive

void forEachChildRecursive(function)

Name Type Description
function function<void(GAME_OBJECT)>

buildMinMaxBounding

boolean buildMinMaxBounding(outMin, outMax)

Name Type Description
outMin vec3f Out argument
outMax vec3f Out argument

getId

Guid getId()


addComponent

COMPONENT addComponent(componentType [, enabled])

Name Type Description
componentType Component Type
enabled boolean

getOrCreateComponent

COMPONENT getOrCreateComponent(componentType)

Name Type Description
componentType Component Type

getComponent

COMPONENT getComponent(type)

Name Type Description
type Component Type

getEnabledComponent

COMPONENT getEnabledComponent(type)

Name Type Description
type Component Type

removeComponent

boolean removeComponent(component)

Name Type Description
component COMPONENT

findFirstParentWithComponent

COMPONENT findFirstParentWithComponent(type)

Name Type Description
type Component Type

findFirstObjectWithComponentUp

COMPONENT findFirstObjectWithComponentUp(type)

Name Type Description
type Component Type

findFirstObjectWithComponentDown

COMPONENT findFirstObjectWithComponentDown(type)

Name Type Description
type Component Type

forEachComponent

void forEachComponent(function)

Name Type Description
function function<void(COMPONENT)>
api/game_object.txt · Last modified: 2020/10/22 10:16 (external edit)