OGRE动画实现(模型自己动),linux操作系统基础教程安俊秀课后答案

这篇博客介绍了如何在OGRE框架中创建动画和移动机器人。首先,通过创建Entity和SceneNode来设定对象,并使用deque存储行走路径。接着,通过AnimationState设置动画状态,使机器人能进行原地踏步。然后,定义了机器人的移动速度和方向,通过判断当前位置和目标位置来更新动画和位置,实现机器人行走效果。最后,通过nextLocation方法检查是否还有更多行走点,并据此切换动画状态。
摘要由CSDN通过智能技术生成

to

std::deque mWalkList; // The list of points we are walking to

Real mWalkSpeed; // The speed at which the object is moving

};

class MoveDemoApplication : public ExampleApplication

{

protected:

public:

MoveDemoApplication()

{

}

~MoveDemoApplication()

{

}

protected:

Entity *mEntity; // The entity of the object we are animating

SceneNode *mNode; // The SceneNode of the object we are moving

std::deque mWalkList; // A deque containing the waypoints

void createScene(void)

{

}

void createFrameListener(void)

{

mFrameListener= new MoveDemoListener(mWindow, mCamera, mNode, mEntity,

mWalkList);

mFrameListener->showDebugOverlay(true);

mRoot->addFrameListener(mFrameListener);

}

};

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32

#define WIN32_LEAN_AND_MEAN

#include “windows.h”

INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )

#else

int main(int argc, char **argv)

#endif

{

// Create application object

MoveDemoApplication app;

try {

app.go();

} catch( Exception& e ) {

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32

MessageBox( NULL, e.getFullDescription().c_st

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值