Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CCylinder Class Reference

Component for rendering cylinder primitives. More...

#include <Primitive/CCylinder.h>

Inheritance diagram for Skylicht::CCylinder:
Skylicht::CLathe Skylicht::CComponentSystem Skylicht::IActivatorObject

Public Member Functions

virtual void initComponent ()
virtual void updateComponent ()
void init ()
 Re-initialize the lathe mesh based on current parameters.
void setRadius (float r)
 Set the cylinder radius.
void setHeight (float h)
 Set the cylinder height.
float getRadius ()
 Get the cylinder radius.
float getHeight ()
 Get the cylinder height.
virtual CObjectSerializablecreateSerializable ()
virtual void loadSerializable (CObjectSerializable *object)
Public Member Functions inherited from Skylicht::CLathe
CMeshgetMesh ()
 Get the generated mesh.
CMaterialgetMaterial ()
 Get the default material.
const SColorgetColor ()
 Get the default material color.
void setColor (const SColor &color)
 Set the default material color.
void setShadowCasting (bool b)
 Enable or disable shadow casting for this object.
bool isShadowCasting ()
 Check if shadow casting is enabled.
Public Member Functions inherited from Skylicht::CComponentSystem
const char * getName ()
virtual void reset ()
virtual void startComponent ()
virtual void endUpdate ()
virtual void onEnable (bool b)
virtual void onUpdateCullingLayer (u32 mask)
void setEnable (bool b)
bool isEnable ()
CGameObject * getGameObject ()
void setEnableSerializable (bool b)
bool isSerializable ()
void addLinkComponent (CComponentSystem *comp)
void removeAllLink ()
Public Member Functions inherited from Skylicht::IActivatorObject
virtual ~IActivatorObject ()
 Virtual destructor for polymorphic activator objects.

Protected Attributes

float m_radius
float m_height
Protected Attributes inherited from Skylicht::CLathe
CMaterialm_material
CMaterialm_customMaterial
bool m_shadowCasting
bool m_useCustomMaterial
bool m_useNormalMap
std::string m_materialPath
SColor m_color
bool m_needReinit
Protected Attributes inherited from Skylicht::CComponentSystem
CGameObject * m_gameObject
bool m_enable
bool m_serializable
std::vector< CComponentSystem * > m_linkComponent

Additional Inherited Members

Static Public Member Functions inherited from Skylicht::CComponentSystem
static int useComponent (CComponentSystem *used)
Protected Member Functions inherited from Skylicht::CLathe
void initMesh (CLatheMesh *mesh)
 Initialize the render mesh and culling data for the component's entity.
Protected Member Functions inherited from Skylicht::CComponentSystem
void setOwner (CGameObject *obj)

Detailed Description

Component for rendering cylinder primitives.

Example

CGameObject* cylinderObj = zone->createEmptyObject();
CCylinder* cylinder = cylinderObj->addComponent<CCylinder>();
cylinder->setRadius(0.5f);
cylinder->setHeight(2.0f);
cylinder->init(); // Required to rebuild procedural mesh after parameter changes
void setHeight(float h)
Set the cylinder height.
Definition CCylinder.h:52
void setRadius(float r)
Set the cylinder radius.
Definition CCylinder.h:43
void init()
Re-initialize the lathe mesh based on current parameters.
This object class stores information for a GameObject.
Definition CGameObject.h:52

Member Function Documentation

◆ createSerializable()

virtual CObjectSerializable * Skylicht::CCylinder::createSerializable ( )
virtual

Reimplemented from Skylicht::CLathe.

◆ getHeight()

float Skylicht::CCylinder::getHeight ( )
inline

Get the cylinder height.

Returns
Height value.

◆ getRadius()

float Skylicht::CCylinder::getRadius ( )
inline

Get the cylinder radius.

Returns
Radius value.

◆ init()

void Skylicht::CCylinder::init ( )
virtual

Re-initialize the lathe mesh based on current parameters.

Implements Skylicht::CLathe.

◆ initComponent()

virtual void Skylicht::CCylinder::initComponent ( )
virtual

Reimplemented from Skylicht::CLathe.

◆ loadSerializable()

virtual void Skylicht::CCylinder::loadSerializable ( CObjectSerializable * object)
virtual

Reimplemented from Skylicht::CLathe.

◆ setHeight()

void Skylicht::CCylinder::setHeight ( float h)
inline

Set the cylinder height.

Parameters
hNew height.

◆ setRadius()

void Skylicht::CCylinder::setRadius ( float r)
inline

Set the cylinder radius.

Parameters
rNew radius.

◆ updateComponent()

virtual void Skylicht::CCylinder::updateComponent ( )
virtual

Reimplemented from Skylicht::CLathe.


The documentation for this class was generated from the following file: