RTS Camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Toktik
Posts: 1
Joined: Sat Apr 30, 2011 2:32 pm

Post by Toktik »

I have working map and camera with ability to move in space.

But I don't understand how to limit movement area (I only should able to move aroundmap)?

As I understand.

Code: Select all

scene::ITriangleSelector* selector = 0; 
   selector = scene->createOctreeTriangleSelector(map->getMesh(0), map_node, 128); 
   map_node->setTriangleSelector(selector); 
and

Code: Select all

scene::ISceneNodeAnimator *collision = scene->createCollisionResponseAnimator( 
      selector,camera,core::vector3df(20,40,20), 
      core::vector3df(0,-2,0), 
      core::vector3df(0,0,0), 
      0.0f); 
   camera->addAnimator(collision); 
is used for that purpose. But that doesn't work. any suggestion?[/code]
booster
Posts: 15
Joined: Thu Nov 19, 2015 8:53 pm

Re: RTS Camera

Post by booster »

Just had a play...

In rtscamera.cpp I changed this:

Code: Select all

if ( core::equals ( fabs ( dp ), 1.f ) )
to:

Code: Select all

if ( core::equals ( fabs ( dp ), f64(1.0) ) )
Also in main.cpp I changed the following:

Code: Select all

 
device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3");
       //device->getFileSystem()->addZipFileArchive("map-20kdm2.pk3");
 
Post Reply