Polyphase Game Engine
Loading...
Searching...
No Matches
Scene Class Reference

#include <Scene.h>

Inheritance diagram for Scene:
Asset Object

Public Member Functions

 DECLARE_ASSET (Scene, Asset)
 
 Scene ()
 
 ~Scene ()
 
virtual void LoadStream (Stream &stream, Platform platform) override
 
virtual void SaveStream (Stream &stream, Platform platform) override
 
virtual void Create () override
 
virtual void Destroy () override
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor () override
 
virtual const char * GetTypeName () override
 
void Capture (Node *root, Platform platform=Platform::Count)
 
NodePtr Instantiate ()
 
template<typename T >
SharedPtr< T > Instantiate ()
 
void ApplyRenderSettings (World *world)
 
uint8_t GetIconOverride () const
 
const std::string & GetMenuOverride () const
 
const std::vector< Property > * GetRootNodeProperties () const
 
- Public Member Functions inherited from Asset
 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual bool Import (const std::string &path, ImportOptions *options=nullptr)
 
virtual const char * GetTypeImportExt ()
 
virtual bool ShouldSnapshotForPie () const
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Protected Member Functions

void AddNodeDef (Node *node, Platform platform, std::vector< Node * > &nodeList)
 
int32_t FindNodeIndex (Node *node, const std::vector< Node * > &nodeList)
 
bool CheckForNodeProps (std::vector< Property > &props)
 

Static Protected Member Functions

static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 

Protected Attributes

std::vector< SceneNodeDefmNodeDefs
 
bool mSetAmbientLightColor = false
 
bool mSetShadowColor = false
 
bool mSetFog = false
 
glm::vec4 mAmbientLightColor = { 0.1f, 0.1f, 0.1f, 1.0f }
 
glm::vec4 mShadowColor = { 0.0f, 0.0f, 0.0f, 0.8f }
 
bool mFogEnabled = false
 
glm::vec4 mFogColor = { 0.0f, 0.0f, 0.0f, 1.0f }
 
FogDensityFunc mFogDensityFunc = FogDensityFunc::Linear
 
float mFogNear = 0.0f
 
float mFogFar = 100.0f
 
uint8_t mIconOverride = 0
 
std::string mMenuOverride
 
- Protected Attributes inherited from Asset
uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Static Protected Attributes

static int32_t sInstantiationCount = 0
 
static std::vector< PendingNodePathsPendingNodePaths
 

Additional Inherited Members

- Static Public Member Functions inherited from Asset
static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Constructor & Destructor Documentation

◆ Scene()

Scene::Scene ( )

◆ ~Scene()

Scene::~Scene ( )

Member Function Documentation

◆ AddNodeDef()

void Scene::AddNodeDef ( Node node,
Platform  platform,
std::vector< Node * > &  nodeList 
)
protected

◆ ApplyRenderSettings()

void Scene::ApplyRenderSettings ( World world)

◆ Capture()

void Scene::Capture ( Node root,
Platform  platform = Platform::Count 
)

◆ CheckForNodeProps()

bool Scene::CheckForNodeProps ( std::vector< Property > &  props)
protected

◆ Create()

void Scene::Create ( )
overridevirtual

Reimplemented from Asset.

◆ DECLARE_ASSET()

Scene::DECLARE_ASSET ( Scene  ,
Asset   
)

◆ Destroy()

void Scene::Destroy ( )
overridevirtual

Reimplemented from Asset.

◆ FindNodeIndex()

int32_t Scene::FindNodeIndex ( Node node,
const std::vector< Node * > &  nodeList 
)
protected

◆ GatherProperties()

void Scene::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

Reimplemented from Asset.

◆ GetIconOverride()

uint8_t Scene::GetIconOverride ( ) const
inline

◆ GetMenuOverride()

const std::string & Scene::GetMenuOverride ( ) const
inline

◆ GetRootNodeProperties()

const std::vector< Property > * Scene::GetRootNodeProperties ( ) const
inline

◆ GetTypeColor()

glm::vec4 Scene::GetTypeColor ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeName()

const char * Scene::GetTypeName ( )
overridevirtual

Reimplemented from Asset.

◆ HandlePropChange()

bool Scene::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
staticprotected

◆ Instantiate() [1/2]

NodePtr Scene::Instantiate ( )

◆ Instantiate() [2/2]

template<typename T >
SharedPtr< T > Scene::Instantiate ( )
inline

◆ LoadStream()

void Scene::LoadStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ SaveStream()

void Scene::SaveStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

Member Data Documentation

◆ mAmbientLightColor

glm::vec4 Scene::mAmbientLightColor = { 0.1f, 0.1f, 0.1f, 1.0f }
protected

◆ mFogColor

glm::vec4 Scene::mFogColor = { 0.0f, 0.0f, 0.0f, 1.0f }
protected

◆ mFogDensityFunc

FogDensityFunc Scene::mFogDensityFunc = FogDensityFunc::Linear
protected

◆ mFogEnabled

bool Scene::mFogEnabled = false
protected

◆ mFogFar

float Scene::mFogFar = 100.0f
protected

◆ mFogNear

float Scene::mFogNear = 0.0f
protected

◆ mIconOverride

uint8_t Scene::mIconOverride = 0
protected

◆ mMenuOverride

std::string Scene::mMenuOverride
protected

◆ mNodeDefs

std::vector<SceneNodeDef> Scene::mNodeDefs
protected

◆ mSetAmbientLightColor

bool Scene::mSetAmbientLightColor = false
protected

◆ mSetFog

bool Scene::mSetFog = false
protected

◆ mSetShadowColor

bool Scene::mSetShadowColor = false
protected

◆ mShadowColor

glm::vec4 Scene::mShadowColor = { 0.0f, 0.0f, 0.0f, 0.8f }
protected

◆ sInstantiationCount

int32_t Scene::sInstantiationCount = 0
staticprotected

◆ sPendingNodePaths

std::vector< PendingNodePath > Scene::sPendingNodePaths
staticprotected

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