-
public class RenderableManagerFactory and manager for renderables, which are entities that can be drawn.
Renderables are bundles of primitives, each of which has its own geometry and material. All primitives in a particular renderable share a set of rendering attributes, such as whether they cast shadows or use vertex skinning. Kotlin usage example:
val entity = EntityManager.get().create() RenderableManager.Builder(1) .boundingBox(Box(0.0f, 0.0f, 0.0f, 9000.0f, 9000.0f, 9000.0f)) .geometry(0, RenderableManager.PrimitiveType.TRIANGLES, vb, ib) .material(0, material) .build(engine, entity) scene.addEntity(renderable)To modify the state of an existing renderable, clients should first use RenderableManager to get a temporary handle called an instance. The instance can then be used to get or set the renderable's state. Please note that instances are ephemeral; clients should store entities, not instances.
- For details about constructing renderables, see RenderableManager.Builder.
- To associate a 4x4 transform with an entity, see TransformManager.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumRenderableManager.PrimitiveTypePrimitive types used in geometry.
public classRenderableManager.BuilderAdds renderable components to entities using a builder pattern.
-
Method Summary
Modifier and Type Method Description booleanhasComponent(int entity)Checks if the given entity already has a renderable component. intgetInstance(int entity)Gets a temporary handle that can be used to access the renderable state. voiddestroy(int entity)Destroys the renderable component in the given entity. voidsetSkinningBuffer(int i, @NonNull() SkinningBuffer skinningBuffer, int count, int offset)Associates a SkinningBuffer to a renderable instance voidsetBonesAsMatrices(int i, @NonNull() Buffer matrices, @IntRange(from = 0, to = 255) int boneCount, @IntRange(from = 0) int offset)Sets the transforms associated with each bone of a Renderable. voidsetBonesAsQuaternions(int i, @NonNull() Buffer quaternions, @IntRange(from = 0, to = 255) int boneCount, @IntRange(from = 0) int offset)Sets the transforms associated with each bone of a Renderable. voidsetMorphWeights(int i, @NonNull() Array<float> weights, @IntRange(from = 0) int offset)Updates the vertex morphing weights on a renderable, all zeroes by default. voidsetMorphTargetBufferAt(int i, @IntRange(from = 0) int level, @IntRange(from = 0) int primitiveIndex, @NonNull() MorphTargetBuffer morphTargetBuffer, @IntRange(from = 0) int offset, @IntRange(from = 0) int count)Changes the morph target buffer for the given primitive. voidsetMorphTargetBufferAt(int i, @IntRange(from = 0) int level, @IntRange(from = 0) int primitiveIndex, @NonNull() MorphTargetBuffer morphTargetBuffer)Utility method to change morph target buffer for the given primitive. intgetMorphTargetCount(int i)Gets the morph target count on a renderable. voidsetAxisAlignedBoundingBox(int i, @NonNull() Box aabb)Changes the bounding box used for frustum culling. voidsetLayerMask(int i, @IntRange(from = 0, to = 255) int select, @IntRange(from = 0, to = 255) int value)Changes the visibility bits. voidsetPriority(int i, @IntRange(from = 0, to = 7) int priority)Changes the coarse-level draw ordering. voidsetChannel(int i, @IntRange(from = 0, to = 3) int channel)Changes the channel of a renderable voidsetCulling(int i, boolean enabled)Changes whether or not frustum culling is on. voidsetLightChannel(int i, @IntRange(from = 0, to = 7) int channel, boolean enable)Enables or disables a light channel.Light channel 0 is enabled by default. booleangetLightChannel(int i, @IntRange(from = 0, to = 7) int channel)Returns whether a light channel is enabled on a specified renderable. voidsetCastShadows(int i, boolean enabled)Changes whether or not the renderable casts shadows. voidsetReceiveShadows(int i, boolean enabled)Changes whether or not the renderable can receive shadows. voidsetScreenSpaceContactShadows(int i, boolean enabled)Changes whether or not the renderable can use screen-space contact shadows. booleanisShadowCaster(int i)Checks if the renderable can cast shadows. booleanisShadowReceiver(int i)Checks if the renderable can receive shadows. BoxgetAxisAlignedBoundingBox(int i, @Nullable() Box out)Gets the bounding box used for frustum culling. intgetPrimitiveCount(int i)Gets the immutable number of primitives in the given renderable. voidsetMaterialInstanceAt(int i, @IntRange(from = 0) int primitiveIndex, @NonNull() MaterialInstance materialInstance)Changes the material instance binding for the given primitive. MaterialInstancegetMaterialInstanceAt(int i, @IntRange(from = 0) int primitiveIndex)Creates a MaterialInstance Java wrapper object for a particular material instance. voidsetGeometryAt(int i, @IntRange(from = 0) int primitiveIndex, @NonNull() RenderableManager.PrimitiveType type, @NonNull() VertexBuffer vertices, @NonNull() IndexBuffer indices, @IntRange(from = 0) int offset, @IntRange(from = 0) int count)Changes the geometry for the given primitive. voidsetGeometryAt(int i, @IntRange(from = 0) int primitiveIndex, @NonNull() RenderableManager.PrimitiveType type, @NonNull() VertexBuffer vertices, @NonNull() IndexBuffer indices)Changes the geometry for the given primitive. voidsetBlendOrderAt(int instance, @IntRange(from = 0) int primitiveIndex, @IntRange(from = 0, to = 65535) int blendOrder)Changes the drawing order for blended primitives. voidsetGlobalBlendOrderEnabledAt(int instance, @IntRange(from = 0) int primitiveIndex, boolean enabled)Changes whether the blend order is global or local to this Renderable (by default). Set<VertexBuffer.VertexAttribute>getEnabledAttributesAt(int i, @IntRange(from = 0) int primitiveIndex)Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer. longgetNativeObject()-
-
Method Detail
-
hasComponent
boolean hasComponent(int entity)
Checks if the given entity already has a renderable component.
-
getInstance
int getInstance(int entity)
Gets a temporary handle that can be used to access the renderable state.
-
destroy
void destroy(int entity)
Destroys the renderable component in the given entity.
-
setSkinningBuffer
void setSkinningBuffer(int i, @NonNull() SkinningBuffer skinningBuffer, int count, int offset)
Associates a SkinningBuffer to a renderable instance
- Parameters:
i- Instance of the RenderableskinningBuffer- SkinningBuffer to usecount- Numbers of bones to setoffset- Offset in the SkinningBuffer
-
setBonesAsMatrices
void setBonesAsMatrices(int i, @NonNull() Buffer matrices, @IntRange(from = 0, to = 255) int boneCount, @IntRange(from = 0) int offset)
Sets the transforms associated with each bone of a Renderable.
- Parameters:
i- Instance of the Renderablematrices- A FloatBuffer containing boneCount 4x4 packed matrices (i.e.boneCount- Number of bones to setoffset- Index of the first bone to set
-
setBonesAsQuaternions
void setBonesAsQuaternions(int i, @NonNull() Buffer quaternions, @IntRange(from = 0, to = 255) int boneCount, @IntRange(from = 0) int offset)
Sets the transforms associated with each bone of a Renderable.
- Parameters:
i- Instance of the Renderablequaternions- A FloatBuffer containing boneCount transforms.boneCount- Number of bones to setoffset- Index of the first bone to set
-
setMorphWeights
void setMorphWeights(int i, @NonNull() Array<float> weights, @IntRange(from = 0) int offset)
Updates the vertex morphing weights on a renderable, all zeroes by default.
The renderable must be built with morphing enabled. In legacy morphing mode, only thefirst 4 weights are considered.
-
setMorphTargetBufferAt
void setMorphTargetBufferAt(int i, @IntRange(from = 0) int level, @IntRange(from = 0) int primitiveIndex, @NonNull() MorphTargetBuffer morphTargetBuffer, @IntRange(from = 0) int offset, @IntRange(from = 0) int count)
Changes the morph target buffer for the given primitive.
The renderable must be built with morphing enabled.
-
setMorphTargetBufferAt
void setMorphTargetBufferAt(int i, @IntRange(from = 0) int level, @IntRange(from = 0) int primitiveIndex, @NonNull() MorphTargetBuffer morphTargetBuffer)
Utility method to change morph target buffer for the given primitive.For details, see the setMorphTargetBufferAt.
-
getMorphTargetCount
@IntRange(from = 0) int getMorphTargetCount(int i)
Gets the morph target count on a renderable.
-
setAxisAlignedBoundingBox
void setAxisAlignedBoundingBox(int i, @NonNull() Box aabb)
Changes the bounding box used for frustum culling.
-
setLayerMask
void setLayerMask(int i, @IntRange(from = 0, to = 255) int select, @IntRange(from = 0, to = 255) int value)
Changes the visibility bits.
-
setPriority
void setPriority(int i, @IntRange(from = 0, to = 7) int priority)
Changes the coarse-level draw ordering.
-
setChannel
void setChannel(int i, @IntRange(from = 0, to = 3) int channel)
Changes the channel of a renderable
-
setCulling
void setCulling(int i, boolean enabled)
Changes whether or not frustum culling is on.
-
setLightChannel
void setLightChannel(int i, @IntRange(from = 0, to = 7) int channel, boolean enable)
Enables or disables a light channel.Light channel 0 is enabled by default.
- Parameters:
i- Instance of the component obtained from getInstance().channel- Light channel to setenable- true to enable, false to disable
-
getLightChannel
boolean getLightChannel(int i, @IntRange(from = 0, to = 7) int channel)
Returns whether a light channel is enabled on a specified renderable.
- Parameters:
i- Instance of the component obtained from getInstance().channel- Light channel to query
-
setCastShadows
void setCastShadows(int i, boolean enabled)
Changes whether or not the renderable casts shadows.
-
setReceiveShadows
void setReceiveShadows(int i, boolean enabled)
Changes whether or not the renderable can receive shadows.
-
setScreenSpaceContactShadows
void setScreenSpaceContactShadows(int i, boolean enabled)
Changes whether or not the renderable can use screen-space contact shadows.
-
isShadowCaster
boolean isShadowCaster(int i)
Checks if the renderable can cast shadows.
-
isShadowReceiver
boolean isShadowReceiver(int i)
Checks if the renderable can receive shadows.
-
getAxisAlignedBoundingBox
@NonNull() Box getAxisAlignedBoundingBox(int i, @Nullable() Box out)
Gets the bounding box used for frustum culling.
-
getPrimitiveCount
@IntRange(from = 0) int getPrimitiveCount(int i)
Gets the immutable number of primitives in the given renderable.
-
setMaterialInstanceAt
void setMaterialInstanceAt(int i, @IntRange(from = 0) int primitiveIndex, @NonNull() MaterialInstance materialInstance)
Changes the material instance binding for the given primitive.
-
getMaterialInstanceAt
@NonNull() MaterialInstance getMaterialInstanceAt(int i, @IntRange(from = 0) int primitiveIndex)
Creates a MaterialInstance Java wrapper object for a particular material instance.
-
setGeometryAt
void setGeometryAt(int i, @IntRange(from = 0) int primitiveIndex, @NonNull() RenderableManager.PrimitiveType type, @NonNull() VertexBuffer vertices, @NonNull() IndexBuffer indices, @IntRange(from = 0) int offset, @IntRange(from = 0) int count)
Changes the geometry for the given primitive.
-
setGeometryAt
void setGeometryAt(int i, @IntRange(from = 0) int primitiveIndex, @NonNull() RenderableManager.PrimitiveType type, @NonNull() VertexBuffer vertices, @NonNull() IndexBuffer indices)
Changes the geometry for the given primitive.
-
setBlendOrderAt
void setBlendOrderAt(int instance, @IntRange(from = 0) int primitiveIndex, @IntRange(from = 0, to = 65535) int blendOrder)
Changes the drawing order for blended primitives. The drawing order is either global orlocal (default) to this Renderable. In either case, the Renderable priority takes precedence.
- Parameters:
instance- the renderable of interestprimitiveIndex- the primitive of interestblendOrder- draw order number (0 by default).
-
setGlobalBlendOrderEnabledAt
void setGlobalBlendOrderEnabledAt(int instance, @IntRange(from = 0) int primitiveIndex, boolean enabled)
Changes whether the blend order is global or local to this Renderable (by default).
- Parameters:
instance- the renderable of interestprimitiveIndex- the primitive of interestenabled- true for global, false for local blend ordering.
-
getEnabledAttributesAt
Set<VertexBuffer.VertexAttribute> getEnabledAttributesAt(int i, @IntRange(from = 0) int primitiveIndex)
Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
-
getNativeObject
long getNativeObject()
-
-
-
-