Jump to content

Recommended Posts

Posted

While trying to getting a camera present in a Map from the C++ side, I found there is 2 cameras (according to world->cameras.size().

  1. What is the second camera ?
  2. How leadweaks choose the camera to render the scene ?

Posted

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.

Posted

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

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.

×
×
  • Create New...