Beispiel #1
0
void CC3ActionMoveDirectionallyBy::update( float t )
{
	GLfloat deltaTime = t - m_prevTime;
	GLfloat deltaDist = m_distance * deltaTime;
	CC3Vector moveDir = getTargetDirection().normalize();
	CC3Vector prevLoc = getTargetNode()->getLocation();
	getTargetNode()->setLocation( prevLoc.add( moveDir.scaleUniform(deltaDist) ) );
	m_prevTime = t;
	
	/*LogTrace(@"%@: time: %.3f, delta time: %.3f, delta dist: %.3f, was at: %@, now at: %@",
				  self, t, deltaTime, deltaDist,
				  NSStringFromCC3Vector(prevLoc),
				  NSStringFromCC3Vector(self.targetCC3Node.location));*/
}
Beispiel #2
0
void CC3ActionRotateByAngle::update( float t )
{
	GLfloat deltaTime = t - m_fPrevTime;
	GLfloat deltaAngle = m_diffAngle * deltaTime;
	getTargetNode()->rotateByAngle( deltaAngle, m_activeRotationAxis );
	m_fPrevTime = t;
}
OgreCharacterController::OgreCharacterController(Ogre::Camera * Camera, const Ogre::String& name, const Ogre::Vector3& position)
  : CharacterController(Camera, position, name, "Sinbad.mesh", Ogre::Vector3(3, 3, 3)), lastTop(0), lastBase(0), 
  mSword1(0), mSword2(0), swordsOut(false), sliceDir(false), animTimer(0)
{
  Ogre::SceneManager * smgr = Camera->getSceneManager();
  Ogre::Entity * ent = getEntity();

  ent->getSkeleton()->setBlendMode(Ogre::ANIMBLEND_CUMULATIVE);

  mSword1 = smgr->createEntity("Sword1", "Sword.mesh");
  mSword2 = smgr->createEntity("Sword2", "Sword.mesh");
  ent->attachObjectToBone("Sheath.L", mSword1);
  ent->attachObjectToBone("Sheath.R", mSword2);

  getTargetNode()->setFixedYawAxis(true);
}
Beispiel #4
0
ccColor4F CC3ActionTintDiffuseTo::getTargetColor()
{
	return getTargetNode()->getDiffuseColor(); 
}
Beispiel #5
0
void CC3ActionTintDiffuseTo::setTargetColor( const ccColor4F& aColor )
{
	getTargetNode()->setDiffuseColor( aColor );  
}
Beispiel #6
0
void CC3ActionRotateTo::setTargetVector( const CC3Vector& aRotation )
{
	getTargetNode()->setRotation( aRotation );
}
Beispiel #7
0
void CC3ActionTintAmbientTo::setTargetColor( const ccColor4F& aColor )
{
	getTargetNode()->setAmbientColor( aColor );  
}
Beispiel #8
0
void CC3ActionAnimate::update( float t )
{
	getTargetNode()->establishAnimationFrameAt( m_isReversed ? (1.0f - t) : t, m_trackID );
}
Beispiel #9
0
void CC3ActionAnimationCrossFade::update( float t )
{
	CC3Node* node = getTargetNode();
	node->setAnimationBlendingWeight( ((1.f - t) * m_startWeight), m_fromTrackID );
	node->setAnimationBlendingWeight( (t * m_endWeight), m_toTrackID );
}
Beispiel #10
0
void CC3ActionMoveTo::setTargetVector( const CC3Vector& aLocation ) 
{
	getTargetNode()->setLocation( aLocation );   
}
Beispiel #11
0
ccColor4F CC3ActionTintEmissionTo::getTargetColor()
{
	return getTargetNode()->getEmissionColor(); 
}
Beispiel #12
0
CC3Vector CC3ActionRotateToLookTowards::getTargetVector()
{
	return getTargetNode()->getForwardDirection();
}
Beispiel #13
0
void CC3ActionRotateToLookTowards::setTargetVector( const CC3Vector& aDirection )
{
	getTargetNode()->setForwardDirection( aDirection );   
}
Beispiel #14
0
void CC3ActionRotateToAngle::update( float t )
{	
	getTargetNode()->setRotationAngle( m_startAngle + (m_diffAngle * t) );
}
Beispiel #15
0
void CC3ActionScaleTo::setTargetVector( const CC3Vector& aScale )
{
	getTargetNode()->setScale( aScale );  
}
Beispiel #16
0
CC3Vector CC3ActionScaleTo::getTargetVector()
{
	return getTargetNode()->getScale(); 
}
Beispiel #17
0
ccColor4F CC3ActionTintSpecularTo::getTargetColor()
{
	return getTargetNode()->getSpecularColor(); 
}
Beispiel #18
0
CC3Vector CC3ActionMoveForwardBy::getTargetDirection()
{
	return getTargetNode()->getForwardDirection(); 
}
Beispiel #19
0
void CC3ActionTintSpecularTo::setTargetColor( const ccColor4F& aColor )
{
	getTargetNode()->setSpecularColor( aColor ); 
}
Beispiel #20
0
CC3Vector CC3ActionMoveRightBy::getTargetDirection()
{
	return getTargetNode()->getRightDirection(); 
}
Beispiel #21
0
void CC3ActionTintEmissionTo::setTargetColor( const ccColor4F& aColor )
{
	getTargetNode()->setEmissionColor( aColor ); 
}
Beispiel #22
0
CC3Vector CC3ActionMoveTo::getTargetVector()
{
	return getTargetNode()->getLocation(); 
}
Beispiel #23
0
void CC3ActionAnimationBlendingFadeTrackTo::update( float t )
{
	getTargetNode()->setAnimationBlendingWeight( m_startWeight + (t * (m_endWeight - m_startWeight)), m_trackID );
}
Beispiel #24
0
ccColor4F CC3ActionTintAmbientTo::getTargetColor()
{
	return getTargetNode()->getAmbientColor(); 
}
Beispiel #25
0
CC3Vector CC3ActionMoveUpBy::getTargetDirection()
{
	return getTargetNode()->getUpDirection(); 
}
Beispiel #26
0
CC3Vector CC3ActionRotateTo::getTargetVector()
{
	return getTargetNode()->getRotation(); 
}