Skylicht Engine
Loading...
Searching...
No Matches
CLathe.h
1#pragma once
2
3#include "LatheMesh/CLatheMesh.h"
4#include "Material/CMaterial.h"
5
6namespace Skylicht
7{
12 class COMPONENT_API CLathe : public CComponentSystem
13 {
14 protected:
15 CMaterial* m_material;
16 CMaterial* m_customMaterial;
17
18 bool m_shadowCasting;
19 bool m_useCustomMaterial;
20 bool m_useNormalMap;
21
22 std::string m_materialPath;
23 SColor m_color;
24
25 bool m_needReinit;
26 public:
27 CLathe();
28
29 virtual ~CLathe();
30
31 virtual void initComponent();
32
33 virtual void updateComponent();
34
38 virtual void init() = 0;
39
45
51 {
52 return m_material;
53 }
54
59 inline const SColor& getColor()
60 {
61 return m_color;
62 }
63
68 void setColor(const SColor& color);
69
74 void setShadowCasting(bool b);
75
80 inline bool isShadowCasting()
81 {
82 return m_shadowCasting;
83 }
84
85 virtual CObjectSerializable* createSerializable();
86
87 virtual void loadSerializable(CObjectSerializable* object);
88
89 DECLARE_GETTYPENAME(CLathe)
90
91 protected:
92
97 void initMesh(CLatheMesh* mesh);
98 };
99}
Base class for rotational (lathe) primitive components like Capsules and Cylinders.
Definition CLathe.h:13
void setShadowCasting(bool b)
Enable or disable shadow casting for this object.
bool isShadowCasting()
Check if shadow casting is enabled.
Definition CLathe.h:80
void setColor(const SColor &color)
Set the default material color.
CMesh * getMesh()
Get the generated mesh.
CMaterial * getMaterial()
Get the default material.
Definition CLathe.h:50
void initMesh(CLatheMesh *mesh)
Initialize the render mesh and culling data for the component's entity.
const SColor & getColor()
Get the default material color.
Definition CLathe.h:59
virtual void init()=0
Re-initialize the lathe mesh based on current parameters.
Base class for procedurally generating lathe-based meshes (rotational geometry).
Definition CLatheMesh.h:15
The object class describes material information such as which shader it's associated with,...
Definition CMaterial.h:84
Definition CMesh.h:75
Definition CObjectSerializable.h:36
Class representing a 32 bit ARGB color.
Definition SColor.h:285
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29