public final class GameObject extends java.lang.Object implements ITree<GameObject>
| Modifier and Type | Field and Description |
|---|---|
AnimationComponent |
animation |
CameraComponent |
camera |
ICollisionComponent |
collision |
IConstraintComponent[] |
constraints |
IComponent[] |
otherComponents |
RenderableComponent |
renderable |
RigidBodyComponent |
rigidBody |
ScriptComponent[] |
scripts |
UiComponent |
ui |
| Constructor and Description |
|---|
GameObject() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(T child) |
boolean |
addComponent(IComponent component) |
void |
destroy()
Destroy this
GameObject and all of its childs. |
void |
destroyNow()
Deprecated.
use
destroy() instead |
T |
getChild(int index) |
<T extends IComponent> |
getComponent(java.lang.Class<T> clazz) |
Array<IComponent> |
getComponents() |
<T extends IComponent> |
getComponents(java.lang.Class<T> clazz,
Array<? super T> dst) |
<T> void |
getComponentsFromInterface(java.lang.Class<T> clazz,
Array<? super T> dst) |
int |
getNumChilds() |
Transform |
getTransform(Transform dst) |
Mat4x4 |
getWorldMatrix(Mat4x4 dst) |
Transform |
getWorldTransform(Transform dst) |
boolean |
hasWorldTransform() |
protected void |
init(GameScreen gameScreen)
Initialize this
GameObject |
boolean |
isActive() |
boolean |
isReady() |
boolean |
isVisible() |
void |
log(java.lang.Throwable t) |
protected void |
onActiveChanged() |
protected void |
onDestroy() |
protected void |
onTransformChanged() |
protected void |
onVisibleChanged() |
void |
processInputs(IInput input)
Process inputs
|
boolean |
removeChild(T child) |
Array<T> |
removeChilds() |
boolean |
removeComponent(IComponent component) |
void |
setNodeActive(boolean nodeActive) |
void |
setNodeVisible(boolean nodeVisible) |
void |
setTransform(Transform src) |
void |
setWorldTransform(Transform t) |
protected void |
start() |
void |
synchronize() |
java.lang.String |
toString() |
void |
transform(Transform t) |
void |
update(long timePassedMs)
Update
|
void |
updateEnd(long timePassedMs)
Update end
|
protected void |
updatePhysicSensor()
Physic sensor callback
|
protected void |
updatePhysicTransform() |
void |
updateStep(long timeStepMs)
Physic fixed step update
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChild, getChild, getNumChildspublic RenderableComponent renderable
public AnimationComponent animation
public ICollisionComponent collision
public RigidBodyComponent rigidBody
public IConstraintComponent[] constraints
public CameraComponent camera
public UiComponent ui
public ScriptComponent[] scripts
public IComponent[] otherComponents
protected final void init(GameScreen gameScreen)
GameObjectprotected final void start()
public final boolean isReady()
public final void updateStep(long timeStepMs)
protected final void updatePhysicSensor()
protected final void onTransformChanged()
protected final void updatePhysicTransform()
public final void processInputs(IInput input)
public final void update(long timePassedMs)
public void updateEnd(long timePassedMs)
public final Array<IComponent> getComponents()
public final <T extends IComponent> T getComponent(java.lang.Class<T> clazz)
clazz - Class of the IComponent to returnpublic final <T extends IComponent> void getComponents(java.lang.Class<T> clazz, Array<? super T> dst)
public final <T> void getComponentsFromInterface(java.lang.Class<T> clazz,
Array<? super T> dst)
public final boolean removeComponent(IComponent component)
component - the IComponent to removepublic final boolean addComponent(IComponent component)
component - IComponent to addpublic final void destroy()
GameObject and all of its childs.GameScreen update.GameScreen.remove(GameObject)@Deprecated public final void destroyNow()
destroy() insteadGameObject nowprotected void onActiveChanged()
protected void onDestroy()
public final void log(java.lang.Throwable t)
public java.lang.String toString()
toString in class java.lang.Objectpublic final void addChild(T child)
public final boolean removeChild(T child)
public final Array<T> removeChilds()
public final int getNumChilds()
public T getChild(int index)
public void setNodeActive(boolean nodeActive)
nodeActive - new value for this T active statepublic boolean isActive()
T impacted by its parents, if anypublic void setNodeVisible(boolean nodeVisible)
nodeVisible - new value for this T visible statepublic boolean isVisible()
T impacted by its parents, if anyprotected void onVisibleChanged()
public final Transform getTransform(Transform dst)
getTransform in interface ITransformabledst - storage of the Transform value (or the identity if the value is null)public final void setTransform(Transform src)
setTransform in interface ITransformablepublic final void transform(Transform t)
transform in interface ITransformablepublic final boolean hasWorldTransform()
public final void setWorldTransform(Transform t)
public final void synchronize()
Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com