BlankMat 0.1.0
Free open-source 3D texture creation application
Loading...
Searching...
No Matches
IEntity Class Referenceabstract
Inheritance diagram for IEntity:
Collaboration diagram for IEntity:

Public Member Functions

virtual void Draw (Shader *shader, State *state, Material *defaultMat, const glm::mat4 &viewProj, bool drawMats=false)=0
 
virtual void DrawShadows (Shader *shader, State *state)=0
 
virtual const glm::vec3 GetPos ()
 
virtual const glm::vec3 GetRot ()
 
virtual const glm::vec3 GetScale ()
 
virtual MaterialGetMaterial ()
 
const glm::vec3 GetUp ()
 
const glm::vec3 GetRight ()
 
const glm::vec3 GetFront ()
 
void Translate (const glm::vec3 &delta)
 
void Rotate (const glm::vec3 &delta)
 
void Scale (const glm::vec3 &delta)
 
const glm::vec3 GetWorldPos ()
 
virtual void SetPos (const glm::vec3 &pos)
 
virtual void SetRot (const glm::vec3 &rot)
 
virtual void SetScale (const glm::vec3 &scale)
 
void CalcBasis ()
 
void LoadMaterial (MaterialContainer *materials)
 
virtual void SetMaterial (Material *material)
 
bool IsEnabled ()
 
bool IsEnabledInHierarchy ()
 
void Enable (bool shouldEnable=true)
 
void EnableParent (bool shouldEnable)
 
bool ToggleEnabled ()
 
virtual void SetParentModelMatrix (const glm::mat4 &parentModelMatrix)
 
const glm::mat4 & GetModelMatrix ()
 
const glm::mat4 & GetParentModelMatrix ()
 
const glm::mat4 & GetSelfModelMatrix ()
 
const glm::mat3 & GetNormalModelMatrix ()
 
 IEntity (const std::string &name="", const std::string &scope="", Material *material=nullptr, bool drawOver=false, const glm::vec3 &pos=glm::vec3(0.0f), const glm::vec3 &rot=glm::vec3(0.0f), const glm::vec3 &scale=glm::vec3(1.0f))
 
 IEntity (const std::string &name, const std::string &scope, const std::string &material, bool drawOver=false, const glm::vec3 &pos=glm::vec3(0.0f), const glm::vec3 &rot=glm::vec3(0.0f), const glm::vec3 &scale=glm::vec3(1.0f))
 
virtual void Cleanup ()
 
- Public Member Functions inherited from ISelectable
virtual SelectableType GetSelectableType ()
 Returns the type of the selectable.
 
 ISelectable (SelectableType type=SelectableType::NONE)
 Sets the type of the selectable.
 
- Public Member Functions inherited from INameable
virtual void Rename (const std::string &newName, bool includeScope=true)
 Renames the object, setting the scope to be the scoped part of the name.
 
virtual void SetName (const std::string &name)
 Sets the name of the object. Note: Does not set the scope variable. If renaming based on raw input, use Rename() instead to set the scope.
 
virtual void SetScope (const std::string &scope)
 Sets the scope of the object.
 
std::string GetUnscopedName ()
 Returns the unscoped name of the object.
 
std::string GetScope ()
 Returns the scope of the object.
 
std::string GetScopedName ()
 Returns the scoped name of the object.
 
void InitName (const std::string &name, const std::string &scope="")
 Initializes the nameable object with the given name and scope.
 
 INameable ()
 Creates a default nameable object without name or scope.
 

Static Public Member Functions

static const std::string GetNameNullSafe (IEntity *entity)
 

Protected Member Functions

virtual void RecalcMatrices ()
 
virtual void UpdateEnabledStatus ()
 
virtual void GenBuffers ()=0
 

Protected Attributes

unsigned int mVAO = 0
 
unsigned int mVBO = 0
 
unsigned int mEBO = 0
 
bool mDrawOver = false
 
glm::vec3 mFront = glm::vec3(0.0f)
 
glm::vec3 mRight = glm::vec3(0.0f)
 
glm::vec3 mUp = glm::vec3(0.0f)
 
glm::vec3 mPos = glm::vec3(0.0f)
 
glm::vec3 mRot = glm::vec3(0.0f)
 
glm::vec3 mScale = glm::vec3(1.0f)
 
bool mIsEnabled = true
 
bool mIsEnabledSelf = true
 
bool mIsEnabledParent = true
 
MaterialmMaterial = nullptr
 
std::string mMaterialName = ""
 
bool mRecalcMatrices = true
 
glm::mat4 mParentModelMatrix = glm::mat4(1.0f)
 
glm::mat4 mSelfModelMatrix = glm::mat4(1.0f)
 
glm::mat4 mModelMatrix = glm::mat4(1.0f)
 
glm::mat3 mNormalModelMatrix = glm::mat3(1.0f)
 
- Protected Attributes inherited from ISelectable
SelectableType mSelectableType = SelectableType::NONE
 Type of the selectable.
 
- Protected Attributes inherited from INameable
std::string mName = ""
 Name of the object.
 
std::string mScope = ""
 Scope of the object.
 

Constructor & Destructor Documentation

◆ IEntity() [1/2]

IEntity::IEntity ( const std::string &  name = "",
const std::string &  scope = "",
Material material = nullptr,
bool  drawOver = false,
const glm::vec3 &  pos = glm::vec3(0.0f),
const glm::vec3 &  rot = glm::vec3(0.0f),
const glm::vec3 &  scale = glm::vec3(1.0f) 
)
inline

◆ IEntity() [2/2]

IEntity::IEntity ( const std::string &  name,
const std::string &  scope,
const std::string &  material,
bool  drawOver = false,
const glm::vec3 &  pos = glm::vec3(0.0f),
const glm::vec3 &  rot = glm::vec3(0.0f),
const glm::vec3 &  scale = glm::vec3(1.0f) 
)
inline

Member Function Documentation

◆ CalcBasis()

void IEntity::CalcBasis ( )
inline

◆ Cleanup()

virtual void IEntity::Cleanup ( )
inlinevirtual

◆ Draw()

virtual void IEntity::Draw ( Shader shader,
State state,
Material defaultMat,
const glm::mat4 &  viewProj,
bool  drawMats = false 
)
pure virtual

◆ DrawShadows()

◆ Enable()

void IEntity::Enable ( bool  shouldEnable = true)
inline

◆ EnableParent()

void IEntity::EnableParent ( bool  shouldEnable)
inline

◆ GenBuffers()

◆ GetFront()

const glm::vec3 IEntity::GetFront ( )
inline

◆ GetMaterial()

virtual Material * IEntity::GetMaterial ( )
inlinevirtual

◆ GetModelMatrix()

const glm::mat4 & IEntity::GetModelMatrix ( )
inline

◆ GetNameNullSafe()

static const std::string IEntity::GetNameNullSafe ( IEntity entity)
inlinestatic

◆ GetNormalModelMatrix()

const glm::mat3 & IEntity::GetNormalModelMatrix ( )
inline

◆ GetParentModelMatrix()

const glm::mat4 & IEntity::GetParentModelMatrix ( )
inline

◆ GetPos()

virtual const glm::vec3 IEntity::GetPos ( )
inlinevirtual

◆ GetRight()

const glm::vec3 IEntity::GetRight ( )
inline

◆ GetRot()

virtual const glm::vec3 IEntity::GetRot ( )
inlinevirtual

◆ GetScale()

virtual const glm::vec3 IEntity::GetScale ( )
inlinevirtual

◆ GetSelfModelMatrix()

const glm::mat4 & IEntity::GetSelfModelMatrix ( )
inline

◆ GetUp()

const glm::vec3 IEntity::GetUp ( )
inline

◆ GetWorldPos()

const glm::vec3 IEntity::GetWorldPos ( )
inline

◆ IsEnabled()

bool IEntity::IsEnabled ( )
inline

◆ IsEnabledInHierarchy()

bool IEntity::IsEnabledInHierarchy ( )
inline

◆ LoadMaterial()

void IEntity::LoadMaterial ( MaterialContainer materials)
inline

◆ RecalcMatrices()

virtual void IEntity::RecalcMatrices ( )
inlineprotectedvirtual

Reimplemented in Node.

◆ Rotate()

void IEntity::Rotate ( const glm::vec3 &  delta)
inline

◆ Scale()

void IEntity::Scale ( const glm::vec3 &  delta)
inline

◆ SetMaterial()

virtual void IEntity::SetMaterial ( Material material)
inlinevirtual

◆ SetParentModelMatrix()

virtual void IEntity::SetParentModelMatrix ( const glm::mat4 &  parentModelMatrix)
inlinevirtual

Reimplemented in PHandle.

◆ SetPos()

virtual void IEntity::SetPos ( const glm::vec3 &  pos)
inlinevirtual

◆ SetRot()

virtual void IEntity::SetRot ( const glm::vec3 &  rot)
inlinevirtual

◆ SetScale()

virtual void IEntity::SetScale ( const glm::vec3 &  scale)
inlinevirtual

◆ ToggleEnabled()

bool IEntity::ToggleEnabled ( )
inline

◆ Translate()

void IEntity::Translate ( const glm::vec3 &  delta)
inline

◆ UpdateEnabledStatus()

virtual void IEntity::UpdateEnabledStatus ( )
inlineprotectedvirtual

Reimplemented in Node.

Member Data Documentation

◆ mDrawOver

bool IEntity::mDrawOver = false
protected

◆ mEBO

unsigned int IEntity::mEBO = 0
protected

◆ mFront

glm::vec3 IEntity::mFront = glm::vec3(0.0f)
protected

◆ mIsEnabled

bool IEntity::mIsEnabled = true
protected

◆ mIsEnabledParent

bool IEntity::mIsEnabledParent = true
protected

◆ mIsEnabledSelf

bool IEntity::mIsEnabledSelf = true
protected

◆ mMaterial

Material* IEntity::mMaterial = nullptr
protected

◆ mMaterialName

std::string IEntity::mMaterialName = ""
protected

◆ mModelMatrix

glm::mat4 IEntity::mModelMatrix = glm::mat4(1.0f)
protected

◆ mNormalModelMatrix

glm::mat3 IEntity::mNormalModelMatrix = glm::mat3(1.0f)
protected

◆ mParentModelMatrix

glm::mat4 IEntity::mParentModelMatrix = glm::mat4(1.0f)
protected

◆ mPos

glm::vec3 IEntity::mPos = glm::vec3(0.0f)
protected

◆ mRecalcMatrices

bool IEntity::mRecalcMatrices = true
protected

◆ mRight

glm::vec3 IEntity::mRight = glm::vec3(0.0f)
protected

◆ mRot

glm::vec3 IEntity::mRot = glm::vec3(0.0f)
protected

◆ mScale

glm::vec3 IEntity::mScale = glm::vec3(1.0f)
protected

◆ mSelfModelMatrix

glm::mat4 IEntity::mSelfModelMatrix = glm::mat4(1.0f)
protected

◆ mUp

glm::vec3 IEntity::mUp = glm::vec3(0.0f)
protected

◆ mVAO

unsigned int IEntity::mVAO = 0
protected

◆ mVBO

unsigned int IEntity::mVBO = 0
protected