pin
05-04-2007 13:34:56
I'm trying to port a snippet that uses Ogre::Real. There's no such variable in the C# version how do I replace it?
i.e how would this look in C#
I more interested in this lines:
Real move = mWalkSpeed * evt.timeSinceLastFrame;
mNode->translate( mDirection * move );
thx
i.e how would this look in C#
Real mWalkSpeed;
bool mWalking; // whether the robot is walking
Ogre::Real mDistance; // the distance to a destination point
Ogre::Vector3 mDirection; // the movement direction
Ogre::Vector3 mDestination; // the destination vector
if ( mWalking )
{
Real move = mWalkSpeed * evt.timeSinceLastFrame;
mDistance -= move;
// if we reach a waypoint, check for the next location
if (mDistance <= 0.0f)
{
mNode->setPosition( mDestination );
mDirection = Vector3::ZERO;
if (! nextLocation( ) )
{
// no other locations found, Idle
setAnimationState(true, true, "Idle");
mWalking = false;
} // if
} // if
else // if we are inbetween waypoints, move toward the next one
{
mNode->translate( mDirection * move );
} // else
// make sure we are walking on the ground
//testGround();
}
I more interested in this lines:
Real move = mWalkSpeed * evt.timeSinceLastFrame;
mNode->translate( mDirection * move );
thx