Jump to content

Question about camera


moechofe
 Share

Recommended Posts

As I recall the C++ default template creates a camera in code.

I have removed the camera from the default C++ template.

 

Also every lightsource is a camera

I confirm this.

 

So, how leadwerk manage to find the good one?

Changing extern Camera* ActiveCamera; don't seem to work for me.

Link to comment
Share on other sites

I use

   std::list<Camera*>::const_iterator camIter = world->cameras.begin();
   while(camIter != world->cameras.end() ){
       if ( (*camIter)->GetClassName() == "Camera" ){
           camera=(*camIter);
       }
       camIter++;
   }
   if ( camera == NULL ) { // if the map did not provide a camera we create our own
       camera = Camera::Create();
       camera->Move(0,2,-5);
   }

 

In place of the create camera code in App.cpp ( after loading the map ).

 

That last camera seems to be the one used, how ever there is no guarantee for this.

  • Upvote 1

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...