moechofe Posted January 26, 2015 Share Posted January 26, 2015 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(). What is the second camera ? How leadweaks choose the camera to render the scene ? Quote Link to comment Share on other sites More sharing options...
Rick Posted January 26, 2015 Share Posted January 26, 2015 As I recall the C++ default template creates a camera in code. Then if you put a camera in your scene via the editor you'd have 2 cameras. Quote Link to comment Share on other sites More sharing options...
Guppy Posted January 26, 2015 Share Posted January 26, 2015 Also every lightsource is a camera Quote 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 More sharing options...
CreativeOcclusion Posted January 26, 2015 Share Posted January 26, 2015 Also every light source is a camera WTF...That's odd indeed.... Quote Link to comment Share on other sites More sharing options...
moechofe Posted January 27, 2015 Author Share Posted January 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
Guppy Posted January 27, 2015 Share Posted January 27, 2015 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. 1 Quote 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 More sharing options...
Rick Posted January 27, 2015 Share Posted January 27, 2015 I always add my camera to the scene and then I personally just look at the name field myself as I control that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.