public final class ModelInstance extends java.lang.Object implements IDestroyable, java.lang.Cloneable, java.lang.Comparable<ModelInstance>, ITransformable, ILod, ICullableNode
| Modifier and Type | Field and Description |
|---|---|
RenderOptions |
renderOptions
Renderer
|
| Constructor and Description |
|---|
ModelInstance() |
ModelInstance(java.lang.String instanceName) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ModelInstance o) |
void |
destroy(IGL gl)
Destroy this
ModelInstance. |
void |
destroyAsync()
Destroy this
ModelInstance asynchronously (destruction delayed) |
SplineAnimator |
getAnimator() |
java.lang.Iterable<? extends ICullableNode> |
getCullableNodes() |
ModelInstance |
getFromInstance() |
AsyncModel |
getFromModel() |
java.lang.String |
getInstanceName()
Deprecated.
could be removed in future release
|
Model |
getInternalModelIfLoaded() |
float |
getLodDistance() |
int |
getLodLevel() |
Mat4x4 |
getMatrix(Mat4x4 m) |
Model |
getModel() |
java.lang.String |
getModelID() |
Model |
getModelIfLoaded() |
int |
getNumLodLevels() |
Transform |
getTransform(Transform dst) |
IVolume<?> |
getVolume(int boundingVolumeOptions) |
void |
instanciate(AsyncModel asyncModel)
Instanciate the geometry from the specified
AsyncModel |
void |
instanciate(AsyncModel asyncModel,
boolean materialDuplicated)
Instanciate the geometry from the specified
AsyncModel |
void |
instanciate(ModelInstance from)
Share the model and animation from the specified
ModelInstance |
boolean |
isCreatedFromInstance() |
boolean |
isCreatedFromInstance(ModelInstance instance) |
boolean |
isCreatedFromModel() |
boolean |
isCreatedFromModel(java.lang.String modelId) |
boolean |
isCulled() |
boolean |
isLoaded() |
boolean |
isLoadingFailed() |
boolean |
isVisible() |
boolean |
isVisibleAndNotCulled() |
void |
onContextLost()
Must be called when the OpenGL Context has been lost.
|
void |
onLoad(OnLoadListener<ModelInstance> listener)
Register listeners to receive a one time notification when this
ModelInstance is loaded. |
void |
render(Renderer renderer)
Render this
ModelInstance |
void |
setAnimator(SplineAnimator animatior) |
void |
setCulled(boolean culled) |
void |
setLodLevel(int lodLevel) |
void |
setTransform(Transform src) |
void |
setVisible(boolean visible) |
java.lang.String |
toString() |
void |
transform(Transform t) |
boolean |
update(long timePassedMS) |
public RenderOptions renderOptions
public ModelInstance()
public ModelInstance(java.lang.String instanceName)
public final java.lang.String toString()
toString in class java.lang.Objectpublic final int compareTo(ModelInstance o)
compareTo in interface java.lang.Comparable<ModelInstance>@Deprecated public final java.lang.String getInstanceName()
public final void instanciate(AsyncModel asyncModel)
AsyncModelpublic final void instanciate(AsyncModel asyncModel, boolean materialDuplicated)
AsyncModelmaterialDuplicated - true to allow instance having different materials, default falsepublic final void instanciate(ModelInstance from)
ModelInstancepublic final void onLoad(OnLoadListener<ModelInstance> listener)
ModelInstance is loaded.ModelInstance is already loaded, the notification is send instantly.public boolean update(long timePassedMS)
timePassedMS - time passed in milli-secondspublic final void render(Renderer renderer)
ModelInstancepublic final void destroy(IGL gl)
ModelInstance.destroy in interface IDestroyablepublic final void destroyAsync()
ModelInstance asynchronously (destruction delayed)public final void onContextLost()
public final Model getModel()
Model, which is always not null (even when loading is not complete).
When asynchronous loading is complete, the instance Model will receive the loaded model and store it in its childs.Model.getChilds()public final Model getModelIfLoaded()
Model or null if loading is not complete.public final Model getInternalModelIfLoaded()
getModel()public final boolean isLoaded()
public final boolean isLoadingFailed()
public final boolean isCreatedFromInstance()
public final boolean isCreatedFromInstance(ModelInstance instance)
public final ModelInstance getFromInstance()
public final boolean isCreatedFromModel()
public final boolean isCreatedFromModel(java.lang.String modelId)
modelId - identifier of the Modelpublic final AsyncModel getFromModel()
public final java.lang.String getModelID()
public final float getLodDistance()
getLodDistance in interface ILodpublic final int getLodLevel()
getLodLevel in interface ILodpublic final int getNumLodLevels()
getNumLodLevels in interface ILodpublic final void setLodLevel(int lodLevel)
setLodLevel in interface ILodlodLevel - lod level to setpublic SplineAnimator getAnimator()
public void setAnimator(SplineAnimator animatior)
public final boolean isVisibleAndNotCulled()
public final void setVisible(boolean visible)
public final boolean isCulled()
public final void setCulled(boolean culled)
public final IVolume<?> getVolume(int boundingVolumeOptions)
getVolume in interface IBoundableboundingVolumeOptions - bounding volume options.BoundingBox or BoundingSphere depending on options.VolumeOptions,
Box,
Sphere,
Cylinder,
Capsulepublic final java.lang.Iterable<? extends ICullableNode> getCullableNodes()
getCullableNodes in interface ICullableNodepublic final Mat4x4 getMatrix(Mat4x4 m)
getMatrix in interface ICullableNodem - destination Mat4x4 to store local matrixpublic 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 ITransformableBonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com