class
Renderable
Renderable represents any visible object in the scene.
It has a mesh, bounds and a set of materials. Renderer will render any Renderable objects visible by a camera.
Public
Methods
SetMesh
Determines the mesh to render.
All sub-meshes of the mesh will be rendered, and you may set individual materials for each sub-mesh.
SetMaterial
Sets a material that will be used for rendering a sub-mesh with the specified index.
If a sub-mesh doesn't have a specific material set then the primary material will be used.
SetMaterial
Sets the primary material to use for rendering.
Any sub-mesh that doesn't have an explicit material set will use this material.
SetMaterials
Determines all materials used for rendering this renderable.
Each of the materials is used for rendering a single sub-mesh. If number of materials is larger than number of sub-meshes, they will be ignored. If lower, the remaining materials will be removed.
SetLayer
Determines the layer bitfield that controls whether a renderable is considered visible in a specific camera.
Renderable layer must match camera layer in order for the camera to render the component.
SetOverrideBounds
Sets bounds that will be used when determining if object is visible.
Only relevant if SetUseOverrideBounds() is set to true.
- bounds
- Bounds in local space.
SetUseOverrideBounds
Enables or disables override bounds.
When enabled the bounds provided to SetOverrideBounds() will be used for determining object visibility, otherwise the bounds from the object's mesh will be used. Disabled by default.
SetWriteVelocity
If enabled this renderable will write per-pixel velocity information when rendered.
This is required for effects such as temporal anti-aliasing and motion blur, but comes with a minor performance overhead. If you are not using those effects you can disable this for a performance gain.
SetCullDistanceFactor
Factor to be applied to the cull distance set in the camera's render settings.
SetAnimation
Determines the animation that will be used for animating the attached mesh.
Note this will automatically be set if an animation component exists on the same scene object as the renderable.
GetAnimation
IsAnimated
Checks is the renderable animated or static.
GetBounds
Gets world bounds of the mesh rendered by this object.
CalculateBounds
Calculates bounds of the visible contents represented by this component (for example a mesh for Renderable).
- bounds
- Bounds of the contents in world space coordinates.
Returns: True if the component has bounds with non-zero volume, otherwise false.
staticGetRttiStatic
GetMesh
Determines the mesh to render.
All sub-meshes of the mesh will be rendered, and you may set individual materials for each sub-mesh.
GetMaterial
Returns the material used for rendering a sub-mesh with the specified index.
GetMaterials
Determines all materials used for rendering this renderable.
Each of the materials is used for rendering a single sub-mesh. If number of materials is larger than number of sub-meshes, they will be ignored. If lower, the remaining materials will be removed.
GetWriteVelocity
If enabled this renderable will write per-pixel velocity information when rendered.
This is required for effects such as temporal anti-aliasing and motion blur, but comes with a minor performance overhead. If you are not using those effects you can disable this for a performance gain.
GetCullDistanceFactor
Factor to be applied to the cull distance set in the camera's render settings.
GetLayer
Determines the layer bitfield that controls whether a renderable is considered visible in a specific camera.
Renderable layer must match camera layer in order for the camera to render the component.
GetAnimType
Returns the type of animation influencing this renderable, if any.
Internal
Methods
Protected
Constructors
Renderable
Renderable
Methods
RefreshAnimation
Updates animation properties depending on the current mesh.
GetCoreDependencies
Populates the provided array with all core objects that this core object depends upon.
Dependencies are required for syncing to the render thread, so the system can be aware to update the dependant objects if a dependency is marked as dirty (for example updating a camera's viewport should also trigger an update on camera so it has a chance to potentially update its data).
OnDependencyDirty
Gets called on an object when one of the dependencies (as returned from GetCoreDependencies()) is marked as dirty.
It gives the dependant object a chance to determine should it mark itself as dirty due to the dependency change. Dirty flags of the dependency object can be examined for more information on what part of the dependency was modified.
GetListenerResources
Retrieves all the resources that the class depends on.
NotifyResourceLoaded
Called when a resource has been fully loaded.
NotifyResourceChanged
Called when the internal resource the resource handle is pointing to changes.
MarkRenderProxyDataDirty
*********************************************************************
MarkCoreObjectDependenciesDirty
Notifies the core object manager that this object is dependant on some other CoreObject(s), and the dependencies changed since the last call to this method.
This will trigger a call to GetCoreDependencies() to collect the new dependencies.
MarkReferencedResourcesDirty
Marks the resource dependencies list as dirty and schedules it for rebuild.
Initialize
Construct any resources the component needs before use.
Called when the parent scene object is initialized. A non-initialized component shouldn't be used in a live scene (i.e. it should not receive any of the component logic updates or events).
OnCreated
Called once when the component has been created.
Called regardless of the state the component is in.
OnBeginPlay
Called once when the component first leaves the Stopped state.
This includes component creation if requirements for leaving Stopped state are met, in which case it is called after OnCreated. Note this is called even if the component is in disabled state.
OnEnabled
Called every time a component leaves the Stopped state, if the component is enabled.
This includes component creation if requirements for leaving the Stopped state are met. When called during creation it is called after OnBeginPlay.
OnDisabled
Called every time a component is placed into the Stopped state.
This includes component destruction if component wasn't already in Stopped state during destruction. When called during destruction it is called before OnDestroyed.
OnDestroyed
Called once just before the component is destroyed.
Called regardless of the state the component is in.
OnSceneChanged
Called when the parent SceneObject's ECS entity is migrated to a new registry (e.g. when moving between scenes).
The old scene and entity are provided so that components can access sub-systems (renderer, physics, etc.) and read any data stored only in ECS fragments.
OnTransformChanged
Called when the component's parent scene object has changed.
Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().
DoOnMeshChanged
Triggered whenever the renderable's mesh changes.
Private
Methods
GetRenderableData
Returns the renderable data from the ECS fragment.
Used by the CRTP getter interface.
GetFragment
Returns the ECS fragment storing renderable data (const).