SpiderPig Posted October 11, 2013 Share Posted October 11, 2013 Is camera->Pick() supposed to work on LE3 Terrain? Or am I using the wrong method... Link to comment Share on other sites More sharing options...
Josh Posted October 11, 2013 Share Posted October 11, 2013 It does work. Internally, camera::Pick just calculates some points and then calls World::Pick. Make sure you are up-to-date with the update utility. 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...
SpiderPig Posted October 11, 2013 Author Share Posted October 11, 2013 I've run the updater then updated my project via the Project manager without success. Here is my terrain set-up code and my pick code; //App::Start() Terrain* terrain = Terrain::Create(1024); terrain->SetLayerTexture(0, Texture::Load("Textures/Terrain/grass_diffuse_1.tex")); terrain->SetLayerScale(0, 3.0, 3.0); //App::Loop() if(window->MouseHit(1)==true) { PickInfo pickinfo; Vec3 pos=window->GetMousePosition(); if(camera->Pick(pos.x,pos.y,pickinfo,0.2,true)) { Entity* selected=pickinfo.entity; } } Perhaps I'm not setting up the terrain correctly? Link to comment Share on other sites More sharing options...
Admin Posted October 11, 2013 Share Posted October 11, 2013 I think you should create your terrain in a map. Note that none of the terrain commands are documented, which means they should not be used. Link to comment Share on other sites More sharing options...
SpiderPig Posted October 11, 2013 Author Share Posted October 11, 2013 I saw that they weren't documented, why can't they be used in c++? I hope that in the future they can be. EDIT : Just created a terrain in the editor and loaded the map into c++, but the picking still didn't work Link to comment Share on other sites More sharing options...
Josh Posted October 12, 2013 Share Posted October 12, 2013 The terrain API is current;y not documented/supported because I can't guarantee it will work on all systems reliably (mobile), whereas building terrain in the editor will always work. The terrain constructor sets the pick mode to 2, so it should work. In an older version of the engine, terrain could not be picked. If you continue to have problems, please upload a simple example and I will debug it. 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...
SpiderPig Posted October 12, 2013 Author Share Posted October 12, 2013 I created a new Lua project and tried picking Terrain within the editor without success as well. I've attached an un-compiled c++ project for you to have a look at. Thanks. PickableTerrain.zip Link to comment Share on other sites More sharing options...
shadmar Posted October 12, 2013 Share Posted October 12, 2013 It is supposed to be fixed for us in the upcoming build. (bug closed 18th september) HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted October 12, 2013 Share Posted October 12, 2013 Thank you. This makes it very easy to debug. 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...
Josh Posted October 12, 2013 Share Posted October 12, 2013 My current build handle raycasting correctly. However, sphere casting (radius>0) does not seem to be working correctly on terrain, and the results are even glitchy on models... 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...
Josh Posted October 12, 2013 Share Posted October 12, 2013 I think the problem goes deeper than Leadwerks. Reported here: http://newtondynamics.com/forum/viewtopic.php?f=9&t=7876 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...
Josh Posted October 31, 2013 Share Posted October 31, 2013 I have not been able to test it, but the problem is reportedly fixed on Julio's end: http://newtondynamics.com/forum/viewtopic.php?f=9&t=7876&p=53933#p53933 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...
Josh Posted November 14, 2013 Share Posted November 14, 2013 Fixed. Note that the radius will presently be ignored for terrain, and just a ray will be cast. 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...
Recommended Posts