Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Bullet Class Reference

#include <Bullet.h>

+ Inheritance diagram for Bullet:
+ Collaboration diagram for Bullet:

Public Member Functions

void Update (float deltaTime) override
 
virtual void Init ()
 
virtual void LoadProperties (const nlohmann::json &json)
 
const std::string & GetName () const
 
void SetName (const std::string &name)
 
GameObjectGetParent ()
 
bool SetParent (GameObject *parent)
 
SceneGetScene ()
 
bool IsAlive () const
 
void MarkForDestroy ()
 
void SetActive (bool active)
 
bool IsActive () const
 
void AddComponent (Component *component)
 
template<typename T , typename = typename std::enable_if_t<std::is_base_of_v<Component, T>>>
T * GetComponent ()
 
GameObjectFindChildByName (const std::string &name)
 
const glm::vec3 & GetPosition () const
 
glm::vec3 GetWorldPosition () const
 
glm::vec2 GetPosition2D () const
 
glm::vec2 GetWorldPosition2D () const
 
void SetPosition (const glm::vec3 &pos)
 
void SetWorldPosition (const glm::vec3 &pos)
 
void SetPosition2D (const glm::vec2 &pos)
 
const glm::quat & GetRotation () const
 
glm::quat GetWorldRotation ()
 
float GetRotation2D () const
 
void SetRotation (const glm::quat &rot)
 
void SetWorldRotation (const glm::quat &rot)
 
void SetRotation2D (float rotation)
 
const glm::vec3 & GetScale () const
 
glm::vec2 GetScale2D () const
 
void SetScale (const glm::vec3 &scale)
 
void SetScale2D (const glm::vec2 &scale)
 
glm::mat4 GetLocalTransform () const
 
glm::mat4 GetLocalTransform2D () const
 
glm::mat4 GetWorldTransform () const
 
glm::mat4 GetWorldTransform2D () const
 

Static Public Member Functions

static GameObjectLoadGLTF (const std::string &path, Scene *scene)
 

Protected Attributes

std::string m_name
 
GameObjectm_parent = nullptr
 
Scenem_scene = nullptr
 
std::vector< std::unique_ptr< GameObject > > m_children
 
std::vector< std::unique_ptr< Component > > m_components
 
bool m_isAlive = true
 
glm::vec3 m_position = glm::vec3(0.0f)
 
glm::quat m_rotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f)
 
glm::vec3 m_scale = glm::vec3(1.0f)
 
bool m_active = true
 

Detailed Description

Definition at line 5 of file Bullet.h.

Member Function Documentation

◆ AddComponent()

void eng::GameObject::AddComponent ( Component component)
inherited

◆ FindChildByName()

GameObject * eng::GameObject::FindChildByName ( const std::string &  name)
inherited

Definition at line 116 of file GameObject.cpp.

References eng::GameObject::m_children, and eng::GameObject::m_name.

Referenced by Player::Init(), and Player::Update().

◆ GetComponent()

template<typename T , typename = typename std::enable_if_t<std::is_base_of_v<Component, T>>>
T * eng::GameObject::GetComponent ( )
inlineinherited

Definition at line 34 of file GameObject.h.

References eng::GameObject::m_components.

◆ GetLocalTransform()

glm::mat4 eng::GameObject::GetLocalTransform ( ) const
inherited

◆ GetLocalTransform2D()

glm::mat4 eng::GameObject::GetLocalTransform2D ( ) const
inherited

◆ GetName()

const std::string & eng::GameObject::GetName ( ) const
inherited

Definition at line 55 of file GameObject.cpp.

References eng::GameObject::m_name.

◆ GetParent()

GameObject * eng::GameObject::GetParent ( )
inherited

◆ GetPosition()

const glm::vec3 & eng::GameObject::GetPosition ( ) const
inherited

Definition at line 134 of file GameObject.cpp.

References eng::GameObject::m_position.

Referenced by eng::CameraComponent::GetViewMatrix().

◆ GetPosition2D()

glm::vec2 eng::GameObject::GetPosition2D ( ) const
inherited

Definition at line 145 of file GameObject.cpp.

References eng::GameObject::m_position.

◆ GetRotation()

const glm::quat & eng::GameObject::GetRotation ( ) const
inherited

◆ GetRotation2D()

float eng::GameObject::GetRotation2D ( ) const
inherited

Definition at line 198 of file GameObject.cpp.

References eng::GameObject::m_rotation.

Referenced by eng::GameObject::GetLocalTransform2D().

◆ GetScale()

const glm::vec3 & eng::GameObject::GetScale ( ) const
inherited

Definition at line 228 of file GameObject.cpp.

References eng::GameObject::m_scale.

◆ GetScale2D()

glm::vec2 eng::GameObject::GetScale2D ( ) const
inherited

Definition at line 233 of file GameObject.cpp.

References eng::GameObject::m_scale.

◆ GetScene()

Scene * eng::GameObject::GetScene ( )
inherited

Definition at line 80 of file GameObject.cpp.

References eng::GameObject::m_scene.

Referenced by eng::ParseGLTFNode().

◆ GetWorldPosition()

glm::vec3 eng::GameObject::GetWorldPosition ( ) const
inherited

◆ GetWorldPosition2D()

glm::vec2 eng::GameObject::GetWorldPosition2D ( ) const
inherited

Definition at line 150 of file GameObject.cpp.

References eng::GameObject::GetWorldTransform2D().

◆ GetWorldRotation()

◆ GetWorldTransform()

◆ GetWorldTransform2D()

◆ Init()

void eng::GameObject::Init ( )
virtualinherited

Reimplemented in JumpPlatform, and Player.

Definition at line 21 of file GameObject.cpp.

◆ IsActive()

bool eng::GameObject::IsActive ( ) const
inherited

Definition at line 100 of file GameObject.cpp.

References eng::GameObject::m_active.

◆ IsAlive()

bool eng::GameObject::IsAlive ( ) const
inherited

Definition at line 85 of file GameObject.cpp.

References eng::GameObject::m_isAlive.

◆ LoadGLTF()

◆ LoadProperties()

void eng::GameObject::LoadProperties ( const nlohmann::json &  json)
virtualinherited

Definition at line 25 of file GameObject.cpp.

◆ MarkForDestroy()

void eng::GameObject::MarkForDestroy ( )
inherited

Definition at line 90 of file GameObject.cpp.

References eng::GameObject::m_isAlive.

Referenced by Update().

◆ SetActive()

void eng::GameObject::SetActive ( bool  active)
inherited

Definition at line 95 of file GameObject.cpp.

References eng::GameObject::m_active.

◆ SetName()

void eng::GameObject::SetName ( const std::string &  name)
inherited

Definition at line 60 of file GameObject.cpp.

References eng::GameObject::m_name.

Referenced by eng::Scene::CreateObject().

◆ SetParent()

bool eng::GameObject::SetParent ( GameObject parent)
inherited

Definition at line 70 of file GameObject.cpp.

References eng::GameObject::m_scene, and eng::Scene::SetParent().

◆ SetPosition()

void eng::GameObject::SetPosition ( const glm::vec3 &  pos)
inherited

◆ SetPosition2D()

void eng::GameObject::SetPosition2D ( const glm::vec2 &  pos)
inherited

Definition at line 176 of file GameObject.cpp.

References eng::GameObject::m_position.

◆ SetRotation()

void eng::GameObject::SetRotation ( const glm::quat &  rot)
inherited

◆ SetRotation2D()

void eng::GameObject::SetRotation2D ( float  rotation)
inherited

Definition at line 223 of file GameObject.cpp.

References eng::GameObject::m_rotation.

◆ SetScale()

void eng::GameObject::SetScale ( const glm::vec3 &  scale)
inherited

Definition at line 238 of file GameObject.cpp.

References eng::GameObject::m_scale.

◆ SetScale2D()

void eng::GameObject::SetScale2D ( const glm::vec2 &  scale)
inherited

Definition at line 243 of file GameObject.cpp.

References eng::GameObject::m_scale.

◆ SetWorldPosition()

void eng::GameObject::SetWorldPosition ( const glm::vec3 &  pos)
inherited

◆ SetWorldRotation()

void eng::GameObject::SetWorldRotation ( const glm::quat &  rot)
inherited

◆ Update()

void Bullet::Update ( float  deltaTime)
overridevirtual

Reimplemented from eng::GameObject.

Definition at line 3 of file Bullet.cpp.

References eng::GameObject::MarkForDestroy(), and eng::GameObject::Update().

Member Data Documentation

◆ m_active

bool eng::GameObject::m_active = true
protectedinherited

◆ m_children

std::vector<std::unique_ptr<GameObject> > eng::GameObject::m_children
protectedinherited

◆ m_components

std::vector<std::unique_ptr<Component> > eng::GameObject::m_components
protectedinherited

◆ m_isAlive

bool eng::GameObject::m_isAlive = true
protectedinherited

Definition at line 87 of file GameObject.h.

Referenced by eng::GameObject::IsAlive(), and eng::GameObject::MarkForDestroy().

◆ m_name

std::string eng::GameObject::m_name
protectedinherited

◆ m_parent

◆ m_position

◆ m_rotation

glm::quat eng::GameObject::m_rotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f)
protectedinherited

◆ m_scale

◆ m_scene

Scene* eng::GameObject::m_scene = nullptr
protectedinherited

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