MeshComponent is a renderable component that holds a reference to a Mesh. It is responsible for rendering the mesh using the transform of its owning actor. This component also supports texture selection via index and texture tiling adjustments.
More...
#include <MeshComponent.h>
|
| MeshComponent (Actor *pOwner, Mesh *pMesh) |
| Constructs a MeshComponent and assigns it to an owning Actor.
|
|
void | Render (IRenderer *rRenderer) override |
| Renders the mesh using the renderer interface. Applies the world transform of the owning actor and texture tiling before rendering.
|
|
RenderType | GetRenderType () override |
| Returns the render type of the component, which is World for MeshComponent. Used to determine how and where in the pipeline the object should be rendered.
|
|
virtual void | SetMesh (Mesh &pMesh) |
| Sets the mesh that this component will render.
|
|
void | SetTextureIndex (size_t pTextureIndex) |
| Sets the index of the texture to be used from the mesh's texture list.
|
|
void | SetTextureTiling (float x, float y) |
| Sets the tiling factor for the mesh's texture. This controls how many times the texture is repeated across the surface.
|
|
| RenderComponent (Actor *pOwner) |
| Constructs the RenderComponent and assigns it to the owning Actor.
|
|
void | OnStart () override |
| Called when the component is started. Registers the component with the scene's renderer for drawing.
|
|
void | OnEnd () override |
| Called when the component is removed or destroyed. Unregisters the component from the renderer.
|
|
virtual int | GetDrawOrder () const |
|
| Component (Actor *pOwner, int pUpdateOrder=100) |
| Constructor for Component.
|
|
virtual | ~Component () |
|
virtual void | Update () |
| Called every frame to update the component. This can be used to perform actions that need to be updated periodically.
|
|
virtual void | OnUpdateWorldTrandform () |
| Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform.
|
|
void | SetActive (bool isActive) |
| Sets the active status of the component.
|
|
void | SetOwner (Actor *pOwner) |
| Sets the actor that owns this component.
|
|
int | GetUpdateOrder () const |
| Returns the update order of the component. Components with lower update orders are updated first.
|
|
Actor * | GetOwner () const |
| Returns the actor that owns this component.
|
|
MeshComponent is a renderable component that holds a reference to a Mesh. It is responsible for rendering the mesh using the transform of its owning actor. This component also supports texture selection via index and texture tiling adjustments.
◆ MeshComponent()
MeshComponent::MeshComponent |
( |
Actor * | pOwner, |
|
|
Mesh * | pMesh ) |
Constructs a MeshComponent and assigns it to an owning Actor.
- Parameters
-
pOwner | Pointer to the Actor that owns this component. |
pMesh | Pointer to the Mesh to render. |
◆ GetRenderType()
◆ Render()
void MeshComponent::Render |
( |
IRenderer * | rRenderer | ) |
|
|
overridevirtual |
Renders the mesh using the renderer interface. Applies the world transform of the owning actor and texture tiling before rendering.
- Parameters
-
rRenderer | Reference to the renderer responsible for drawing. |
Implements RenderComponent.
◆ SetMesh()
void MeshComponent::SetMesh |
( |
Mesh & | pMesh | ) |
|
|
virtual |
Sets the mesh that this component will render.
- Parameters
-
pMesh | Reference to the Mesh object. |
◆ SetTextureIndex()
void MeshComponent::SetTextureIndex |
( |
size_t | pTextureIndex | ) |
|
Sets the index of the texture to be used from the mesh's texture list.
- Parameters
-
pTextureIndex | The index of the texture to use. |
◆ SetTextureTiling()
void MeshComponent::SetTextureTiling |
( |
float | x, |
|
|
float | y ) |
Sets the tiling factor for the mesh's texture. This controls how many times the texture is repeated across the surface.
- Parameters
-
x | Tiling amount in the X direction. |
y | Tiling amount in the Y direction. |
◆ mMesh
Mesh* MeshComponent::mMesh |
|
protected |
Pointer to the mesh to render.
◆ mTextureIndex
size_t MeshComponent::mTextureIndex |
|
protected |
Index of the texture to apply from the mesh's texture list.
◆ mTiling
Texture tiling factor (1,1 means no tiling)
The documentation for this class was generated from the following files: