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

Component for rendering capsule primitives. More...

#include <Primitive/CCapsule.h>

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

Public Member Functions

virtual void initComponent ()
virtual void updateComponent ()
virtual void init ()
 Re-initialize the lathe mesh based on current parameters.
void setRadius (float r)
 Set the radius of the capsule's spherical caps.
void setHeight (float h)
 Set the total height of the capsule.
float getRadius ()
 Get the capsule's radius.
float getHeight ()
 Get the capsule's total 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 capsule primitives.

Example

CGameObject* capsuleObj = zone->createEmptyObject();
CCapsule* capsule = capsuleObj->addComponent<CCapsule>();
capsule->setRadius(0.5f);
capsule->setHeight(1.2f);
capsule->init(); // Required to rebuild procedural mesh after parameter changes
void setHeight(float h)
Set the total height of the capsule.
Definition CCapsule.h:52
void setRadius(float r)
Set the radius of the capsule's spherical caps.
Definition CCapsule.h:43
virtual 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::CCapsule::createSerializable ( )
virtual

Reimplemented from Skylicht::CLathe.

◆ getHeight()

float Skylicht::CCapsule::getHeight ( )
inline

Get the capsule's total height.

Returns
Height value.

◆ getRadius()

float Skylicht::CCapsule::getRadius ( )
inline

Get the capsule's radius.

Returns
Radius value.

◆ init()

virtual void Skylicht::CCapsule::init ( )
virtual

Re-initialize the lathe mesh based on current parameters.

Implements Skylicht::CLathe.

◆ initComponent()

virtual void Skylicht::CCapsule::initComponent ( )
virtual

Reimplemented from Skylicht::CLathe.

◆ loadSerializable()

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

Reimplemented from Skylicht::CLathe.

◆ setHeight()

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

Set the total height of the capsule.

Parameters
hNew height.

◆ setRadius()

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

Set the radius of the capsule's spherical caps.

Parameters
rNew radius.

◆ updateComponent()

virtual void Skylicht::CCapsule::updateComponent ( )
virtual

Reimplemented from Skylicht::CLathe.


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