R-Type
R-Type project
KapEngine::Transform Class Reference
Inheritance diagram for KapEngine::Transform:
KapEngine::Component KapEngine::IComponent

Public Member Functions

 Transform (std::shared_ptr< GameObject > go)
 
void onAwake () override
 call component awake More...
 
void onDisplay () override
 use to display some things this function is call after all updates fucntion
 
void setPosition (Tools::Vector3 pos)
 Set the GameObject Position. More...
 
void setRotation (Tools::Vector3 rot)
 Set the GameObject Rotation. More...
 
void setScale (Tools::Vector3 scale)
 Set the GameObject Scale. More...
 
Tools::Vector3 getLocalPosition () const
 Get the Local Position of GameObject. More...
 
Tools::Vector3 getLocalRotation () const
 Get the Local Rotation of GameObject. More...
 
Tools::Vector3 getLocalScale () const
 Get the Local Scale of GameObject. More...
 
Tools::Vector3 getWorldPosition () const
 Get the World Position of GameObject. More...
 
Tools::Vector3 getWorldRotation () const
 Get the World Rotation of GameObject. More...
 
Tools::Vector3 getWorldScale () const
 Get the World Scale of GameObject. More...
 
void setParent (std::size_t id)
 Set the Parent by it's id. More...
 
void setParent (std::any val)
 Set the Parent by unknown type. More...
 
bool allParentIsActive ()
 return if all parents are active More...
 
std::size_t getParentId () const
 Get the Parent GameObject Id. More...
 
Entity getParentEntity () const
 Get the Parent Entity. More...
 
std::shared_ptr< GameObjectgetParent () const
 Get the Parent GameObject. More...
 
std::vector< std::shared_ptr< GameObject > > getChildren ()
 Get the Children of gameObject. More...
 
bool parentContainsComponent (std::string const &componentName, bool recurcively=false)
 check parent contain a specific component More...
 
bool parentContainsComponents (std::vector< std::string > componentsName, bool recurcively=false)
 check parent contain specific components More...
 
std::size_t getParentContainsComponent (std::string const &componentName)
 Get the Parent Contains Component recurcively. More...
 
bool allParentsActive () const
 check if all parents are active More...
 
bool hasChanged ()
 check if transform changed since last update More...
 
void __addChild (std::size_t id)
 
void __removeChild (std::size_t id)
 
- Public Member Functions inherited from KapEngine::Component
 Component (std::shared_ptr< GameObject > &go, std::string const &name)
 
 Component (GameObject &go, std::string const &name)
 
void __update (bool runDisplay=true)
 function call by KapEngine to update your component More...
 
bool __setId (std::size_t i)
 function call by KapEngine to init your component More...
 
GameObjectgetGameObject () const
 Get the Game Object object. More...
 
std::size_t getGameObjectId () const
 
virtual void onInit () override
 call on component init More...
 
virtual void onStart () override
 call component start More...
 
virtual void onUpdate () override
 call each frame
 
virtual void onFixedUpdate () override
 call eachv x ms More...
 
virtual void onTriggerEnter (std::shared_ptr< GameObject > go) override
 something enter in object More...
 
virtual void onTriggerStay (std::shared_ptr< GameObject > go) override
 something stay in object More...
 
virtual void onTriggerExit (std::shared_ptr< GameObject > go) override
 something out of object More...
 
virtual void onMouseEnter () override
 called when mouse enter object More...
 
virtual void onMouseStay () override
 called when mouse stay on object More...
 
virtual void onMouseExit () override
 called when mouse leave object More...
 
virtual bool checkComponentValidity () override
 Check you component is runnable With this function you can add some conditions to make your component runnable or not. More...
 
virtual void onGameQuit () override
 call when game is turn off More...
 
virtual void onDestroy () override
 call when component destroyed More...
 
virtual void onDisable () override
 call when GameObject is disable after being enable More...
 
virtual void onEnable () override
 call when GameObject is enable after being disable More...
 
virtual void onSceneUpdated () override
 call when scene is updated (not threaded) More...
 
virtual void onSceneGonnaUpdated () override
 call when scene will update (not threaded) More...
 
virtual void onSceneChanged () override
 call when scene is changed More...
 
std::size_t getLevel () const
 Get the Level component. More...
 
void setLevel (std::size_t lvl)
 Set the Level object. More...
 
bool isEnable () const
 return if component is enable More...
 
bool isDisable () const
 return if component is disbale More...
 
void setActive (bool b)
 Set the active status of component if true : component is active else component is disable. More...
 
std::string getName () const
 Get the component name. More...
 
void __engineStop ()
 
int getThreadRunning () const
 Get the Thread Running index index of thread component. More...
 
Events::Input getInput ()
 Get input events. More...
 
Events::Mouse getMouse ()
 Get mouse events. More...
 
void addRequireComponent (std::string const &componentName)
 Add require component If your component need another component to work, you can add it's name with this function. Without the component require this component cannot run. More...
 
void __fixedUpdate ()
 
void __awake ()
 check awake validity More...
 
TransformgetTransform ()
 Get the Transform component. More...
 
std::size_t getId () const
 Get the Id of component. More...
 
void __setPhysics (bool b)
 set if it is a physic component if component is a physic component then it will be updated in physic thread if engine is threaded More...
 
bool __isPhysics () const
 check if component is a physic component More...
 
void __sceneChanged ()
 
SceneManagement::ScenegetScene () const
 
KEnginegetEngine () const
 

Additional Inherited Members

- Protected Attributes inherited from KapEngine::Component
std::string _name
 Component name.
 

Member Function Documentation

◆ allParentIsActive()

bool KapEngine::Transform::allParentIsActive ( )

return if all parents are active

Returns
true
false

◆ allParentsActive()

bool KapEngine::Transform::allParentsActive ( ) const

check if all parents are active

Returns
true if all parents are active
false if one of parents is not active

◆ getChildren()

std::vector< std::shared_ptr< KapEngine::GameObject > > KapEngine::Transform::getChildren ( )

Get the Children of gameObject.

Returns
std::vector<std::shared_ptr<KapEngine::GameObject>>

◆ getLocalPosition()

KapEngine::Tools::Vector3 KapEngine::Transform::getLocalPosition ( ) const

Get the Local Position of GameObject.

@returnn KapEngine::Tools::Vector3

◆ getLocalRotation()

KapEngine::Tools::Vector3 KapEngine::Transform::getLocalRotation ( ) const

Get the Local Rotation of GameObject.

@returnn KapEngine::Tools::Vector3

◆ getLocalScale()

KapEngine::Tools::Vector3 KapEngine::Transform::getLocalScale ( ) const

Get the Local Scale of GameObject.

@returnn KapEngine::Tools::Vector3

◆ getParent()

std::shared_ptr< KapEngine::GameObject > KapEngine::Transform::getParent ( ) const

Get the Parent GameObject.

Returns
std::shared_ptr<KapEngine::GameObject>

◆ getParentContainsComponent()

std::size_t KapEngine::Transform::getParentContainsComponent ( std::string const &  componentName)

Get the Parent Contains Component recurcively.

Parameters
componentNamename of component to find
Returns
std::size_t

◆ getParentEntity()

Entity KapEngine::Transform::getParentEntity ( ) const

Get the Parent Entity.

Returns
KapEngine::Entity

◆ getParentId()

std::size_t KapEngine::Transform::getParentId ( ) const

Get the Parent GameObject Id.

Returns
std::size_t

◆ getWorldPosition()

KapEngine::Tools::Vector3 KapEngine::Transform::getWorldPosition ( ) const

Get the World Position of GameObject.

Returns
KapEngine::Tools::Vector3

◆ getWorldRotation()

KapEngine::Tools::Vector3 KapEngine::Transform::getWorldRotation ( ) const

Get the World Rotation of GameObject.

Returns
KapEngine::Tools::Vector3

◆ getWorldScale()

KapEngine::Tools::Vector3 KapEngine::Transform::getWorldScale ( ) const

Get the World Scale of GameObject.

Returns
KapEngine::Tools::Vector3

◆ hasChanged()

bool KapEngine::Transform::hasChanged ( )

check if transform changed since last update

Returns
true
false

◆ onAwake()

void KapEngine::Transform::onAwake ( )
overridevirtual

call component awake

will be called at runtime when the scene is first loaded or when another scene has been loaded before.

Reimplemented from KapEngine::Component.

◆ parentContainsComponent()

bool KapEngine::Transform::parentContainsComponent ( std::string const &  componentName,
bool  recurcively = false 
)

check parent contain a specific component

Parameters
componentNamename of component research
recurcivelyexecute this action if component did not find on parent
Returns
true if parent contains component
false if object does not have parent or parent does not have component

◆ parentContainsComponents()

bool KapEngine::Transform::parentContainsComponents ( std::vector< std::string >  componentsName,
bool  recurcively = false 
)

check parent contain specific components

Parameters
componentsNamelist of components's name research
recurcivelyexecute this action if components did not find on parent
Returns
true if parent contains components
false if object does not have parent or parent does not have components

◆ setParent() [1/2]

void KapEngine::Transform::setParent ( std::any  val)

Set the Parent by unknown type.

Parameters
val

◆ setParent() [2/2]

void KapEngine::Transform::setParent ( std::size_t  id)

Set the Parent by it's id.

Parameters
id

◆ setPosition()

void KapEngine::Transform::setPosition ( Tools::Vector3  pos)

Set the GameObject Position.

Parameters
pos(KapEngine::Tools::Vector3)

◆ setRotation()

void KapEngine::Transform::setRotation ( Tools::Vector3  rot)

Set the GameObject Rotation.

Parameters
rot(KapEngine::Tools::Vector3)

◆ setScale()

void KapEngine::Transform::setScale ( Tools::Vector3  scale)

Set the GameObject Scale.

Parameters
scale(KapEngine::Tools::Vector3)

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