- 积分
- 22
- 帖子
- 11
- 主题
- 1
- 精华
- 0
- 最后登录
- 2010-5-22
- 在线时间
- 5 小时
- 私信
|
发表时间 : 2010-4-20 19:57:51
|
浏览 : 1251 评论 : 4
我的程序如下:
#include <vsgu.h>
#include <vp.h>
#include <vpApp.h>
#include "vuAllocTracer.h"
#include "vpObject.h"
#include "vpPathWayPointSet.h"
#include "vpPathNavigator.h"
#include "vpPathWay.h"
#include "vpInputMouse.h"
vuAllocTracer tracer(true, true);
class myApp : public vpApp {
public:
/**
* Constructor
*/
myApp() {}
/**
* Destructor
*/
~myApp()
{
// unreference member variables which cache Vega Prime class instances
}
/**
* Configure my app
*/
int configure()
{
// configure vega prime system first
vpApp::configure();
// Init waypoints for path specification
vpPathWayPointSet* waypoints = new vpPathWayPointSet("Obs_WayPointSet.way");
waypoints->ref();
vpPathNavigator* navigator = new vpPathNavigator("Obs_Navigator.nav");
navigator->ref();
vpObserver* obs = vpObserver::find( "myObserver" );
if (obs)
{
obs->setStrategy(navigator);
obs->setStrategyEnable(true);
}
return vsgu::SUCCESS;
}
};
int main(int argc, char *argv[])
{
// initialize vega prime
vp::initialize(argc, argv);
// create a vpApp instance
vpApp *app = new vpApp;
// load acf file
if (argc <= 1)
app->define("ok all model.acf");
else
app->define(argv[1]);
// configure my app
app->configure();
// runtime loop
app->run();
// unref my app instance
app->unref();
// shutdown vega prime
vp::shutdown();
return 0;
}
想用程序控制实现Observer沿着Obs_Navegator设定的路径运动,但是没做到,想请教哪位高手解决一下。谢谢啊! |
|