Permalink
Browse files

Merge branch 'master' of http://github.com/Phosfor/Pseudoform-2

  • Loading branch information...
2 parents 155b8af + 2f90f57 commit a524d96e1996905fb07ae827bcee23f84c84d993 @max-frai max-frai committed Aug 27, 2010
Showing with 18 additions and 16 deletions.
  1. +2 −2 include/Managers/EntityManager.hpp
  2. +16 −14 src/Managers/Entities/Entity.cpp
@@ -45,14 +45,14 @@ class EntityManager : public singleton<EntityManager>
{
if (mEntityList.count(entityName) != 0)
{
- LOG_META(FORMAT("Can`t make entity with name '%1%' because it's already exsists!", entityName));
+ LOG_META(FORMAT("Can`t make entity with name '%1%' because it already exsists!", entityName));
return NULL;
}
mEntityList.insert(entityName, new EntityType(entityName));
return dynamic_cast<EntityType*>(&mEntityList.at(entityName));
}
-
+
template<typename EntityType>
EntityType *GetEntity(const string &entityName)
{
@@ -5,20 +5,20 @@ Entity::~Entity() { }
// =============================================================================
// Getters
const string Entity::getName() const
-{
+{
return mEntityName;
}
const string Entity::getMeshName() const
-{
+{
return mEntityMesh;
}
bool Entity::isDrawable() const
-{
+{
return mDrawable;
}
Ogre::SceneNode *Entity::getNode() const
-{
+{
return mNode;
}
Ogre::Entity *Entity::getEntity() const
@@ -27,47 +27,47 @@ Ogre::Entity *Entity::getEntity() const
}
const vec3 &Entity::getPosition() const
-{
+{
return mNode->getPosition();
}
const quat &Entity::getOrientation() const
-{
+{
return mNode->getOrientation();
}
const vec3 &Entity::getScale() const
-{
+{
return mNode->getScale();
}
// =============================================================================
// Setters
void Entity::setName(const string &entityName)
-{
+{
mEntityName = entityName;
}
void Entity::setMeshName(const string &meshPath)
-{
+{
mEntityMesh = meshPath;
}
void Entity::setDrawable(bool state)
-{
+{
mDrawable = state;
}
void Entity::setMaterial(const string &matName, const string &group)
-{
+{
mEntity->setMaterialName(matName, group);
}
void Entity::setPosition(const vec3 &pos)
{
mNode->setPosition(pos);
}
void Entity::setRotation(const quat &rot)
-{
+{
mNode->setOrientation(rot);
}
void Entity::setScale(const vec3 &scale)
-{
+{
mNode->setScale(scale);
}
@@ -140,7 +140,9 @@ void Entity::_defaultLoader(const string &entityName)
// Orientation
argName = tree_handle.get<string>("common_settigns.orientation", "1, 1, 1");
if (parseArguments("orientation", argName, storage, parseStorage))
- setRotation(quat(storage[0], storage[1], storage[2]));
+ setRotation(quat(deg(storage[0]), Ogre::Vector3::UNIT_X) *
+ quat(deg(storage[1]), Ogre::Vector3::UNIT_Y) *
+ quat(deg(storage[2]), Ogre::Vector3::UNIT_Z));
// Scale
argName = tree_handle.get<string>("common_settigns.scale", "1, 1, 1");

0 comments on commit a524d96

Please sign in to comment.