Ejemplo n.º 1
0
void MovableObjectRenderer::rescaleAxisMarker()
{
	if (mAxesNode && getMovableObject()) {
		Ogre::Real axesScale = (getMovableObject()->getBoundingRadius() / 5.0f);
		mAxesNode->setScale(axesScale, axesScale, axesScale);
	}
}
Ejemplo n.º 2
0
EnemyCharacter::EnemyCharacter(const std::string& name,const std::string& script,Ogre::SceneNode* node,CrowdManager* crowdMgr,DamageInterface* damageInterface)
	: NPCCharacter(name,script,node,crowdMgr),
	  _damageInterface(damageInterface)
{
	_name = name;
	_scriptName = script;

	Ogre::Entity* ent = static_cast<Ogre::Entity*>(getMovableObject());

	//this will probably have to change
	node->scale(CHARACTER_SCALE_FACTOR,CHARACTER_SCALE_FACTOR,CHARACTER_SCALE_FACTOR);

	if(ent != nullptr)
	{
		std::cout << "EnemyCharacter \'" << name << "\' has an entity attached." << std::endl;
		Ogre::AnimationStateSet* animSet = ent->getAllAnimationStates();
		if(animSet != nullptr)
		{
			std::cout << " - has animations" << std::endl;
			_animHandler.setEntity(ent);
			_animHandler.init("Idle",true);
		}
		else
		{
			std::cout << " - doesn't have animations" << std::endl;
			_animHandler.setEntity(nullptr);
		}
	}

	//set up the weapon
	_currentWeapon.node = nullptr;
	_currentWeapon.weapon = nullptr;

	_prevBhv = AI::BHV_IDLE;
	_prevAct = AI::ACT_IDLE;
	_isBhvFinished = true;
	_isActFinished = true;

	_bhvChange = false;
	_actChange = false;
}
Ejemplo n.º 3
0
NPCCharacter::NPCCharacter(const std::string& name,const std::string& script,Ogre::SceneNode* node,CrowdManager* crowdMgr)
	: BaseEntity(false,LevelData::NPC),
	  Character(node,crowdMgr,node->getPosition())
{
	_name = name;
	_scriptName = script;

	//check for animations
	Ogre::Entity* ent = static_cast<Ogre::Entity*>(getMovableObject());
	
	node->scale(CHARACTER_SCALE_FACTOR,CHARACTER_SCALE_FACTOR,CHARACTER_SCALE_FACTOR);
	if(ent != nullptr)
	{
		std::cout << "NPCCharacter \'" << name << "\' has an entity attached." << std::endl;
		Ogre::AnimationStateSet* animSet = ent->getAllAnimationStates();
		if(animSet != nullptr)
		{
			std::cout << "  - has animations" << std::endl;
			_animHandler.setEntity(ent);
			_animHandler.init("Idle",true);
		}
		else
		{
			std::cout << " - doesn't have animations" << std::endl;
			_animHandler.setEntity(NULL);
		}
	}

	_prevBhv = 0;
	_prevAct = 0;
	_isBhvFinished = true;
	_isActFinished = true;

	_bhvChange = false;
	_actChange = false;
}
Ejemplo n.º 4
0
void MovableObjectRenderer::showFull()
{
	mTexture->getRenderContext()->showFull(getMovableObject());
}
Ejemplo n.º 5
0
	//-----------------------------------------------------------------------
	Light* PCZSceneManager::getLight(const String& name) const
	{
		return static_cast<Light*>(
			getMovableObject(name, PCZLightFactory::FACTORY_TYPE_NAME));
	}