metaldc4life Posted September 14, 2014 Share Posted September 14, 2014 Hi, I was just wondering why the camera is not on the player controller when I try to move around because I can hear him walkin jumping and the like but it's like a mile away from him? Anyone know why!? i'm using c++ now with Microsoft visual studio express.. Thanks.. oh and here's the code: #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } bool App::Start() { window = Window::Create("hello world", 800, 600, Leadwerks::Window::Titlebar); //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Leadwerks::Window::Create(""); //Create a context context = Context::Create(window); //Create a world world = World::Create(); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); //Hide the mouse cursor window->HideMouse(); std::string mapname = System::GetProperty("map","Maps/start.map"); Map::Load(mapname); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); return true; } bool App::Loop() { //Close the window to end the program if (window->Closed()) return false; //Press escape to end freelook mode if (window->KeyHit(Key::Escape)); } Quote Link to comment Share on other sites More sharing options...
Josh Posted September 14, 2014 Share Posted September 14, 2014 The C++ default program creates a camera in the scene controlled by the mouse and keyboard. Just remove the camera creation and control lines in the code above and it will behave the same as the Lua project. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
metaldc4life Posted September 14, 2014 Author Share Posted September 14, 2014 oh ok! thank you I will give it a shot.. thanks again! =) 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.