User Tools

Site Tools


api:game_object

GAME_OBJECT

Abstract class
Category: Data

Properties


Position

Serialized

  • Type: vec3f
  • Expected: vec3f value

Scale

Serialized

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

Orientation

Serialized


Name

Serialized

  • Type: string
  • Expected: string value

Active

Serialized

  • Type: boolean
  • Expected: boolean value

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

isParentedTo

boolean isParentedTo(parent)

Name Type Description
parent GAME_OBJECT

forEachChild

void forEachChild(function)

Name Type Description
function function<void|boolean(GAME_OBJECT child)> If false is returned, the iteration stops. Returns true by default.

forEachChildRecursive

void forEachChildRecursive(function)

Name Type Description
function function<void|boolean(GAME_OBJECT child)> If false is returned, the iteration stops. Returns true by default.

forEachComponent

void forEachComponent(function)

Name Type Description
function function<void|boolean(COMPONENT)> If false is returned, the iteration stops. Returns true by default.

forEachComponentReverse

void forEachComponentReverse(function)

Name Type Description
function function<void|boolean(COMPONENT)> If false is returned, the iteration stops. Returns true by default.

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 [, replaceExistingVariant])

Name Type Description
componentType component_type
replaceExistingVariant boolean

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 [, ignoreDestroyingObject])

Name Type Description
type component_type
ignoreDestroyingObject boolean
api/game_object.txt · Last modified: 2024/02/06 13:53 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki