Big changes
This commit is contained in:
59
engine/server/entity.cpp
Normal file
59
engine/server/entity.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#include "utils/logger.h"
|
||||
|
||||
#include "server/entity.h"
|
||||
|
||||
IMPLEMENT_RTTI_BASE( Entity );
|
||||
|
||||
Entity::Entity() :
|
||||
m_position(0.0f), m_rotation(0.0f), m_scale(1.0f),
|
||||
m_model(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
Entity::~Entity()
|
||||
{
|
||||
}
|
||||
|
||||
void Entity::LoadModel(const char* filename)
|
||||
{
|
||||
//m_model = g_modelManager->LoadModel(filename);
|
||||
//if (!m_model)
|
||||
//{
|
||||
// Msg("Failed to load %s, no physic or animation", filename);
|
||||
// return;
|
||||
//}
|
||||
|
||||
//// get model bounds
|
||||
//m_boundingBox = m_model->GetBoundingBox();
|
||||
}
|
||||
|
||||
IMPLEMENT_RTTI( LightEntity, Entity );
|
||||
|
||||
LightEntity::LightEntity()
|
||||
{
|
||||
}
|
||||
|
||||
LightEntity::~LightEntity()
|
||||
{
|
||||
}
|
||||
|
||||
void TestRTTI()
|
||||
{
|
||||
Entity* entity = new Entity();
|
||||
LogMsg("entity classname: %s", entity->GetRuntimeClass()->m_pClassName);
|
||||
|
||||
LightEntity* light = new LightEntity();
|
||||
LogMsg("light classname: %s", light->GetRuntimeClass()->m_pClassName);
|
||||
|
||||
LightEntity* lightCasted = DynamicCast< LightEntity, Entity >( entity );
|
||||
LogMsg("light from entity casted: %s", lightCasted ? "successful" : "failed");
|
||||
|
||||
delete entity;
|
||||
entity = light;
|
||||
|
||||
lightCasted = DynamicCast< LightEntity, Entity >( entity );
|
||||
LogMsg("light from entity(LightEntity) casted: %s", lightCasted ? "successful" : "failed");
|
||||
|
||||
entity = NULL;
|
||||
delete light;
|
||||
}
|
||||
Reference in New Issue
Block a user