Jump to content

Camera->Pick() Terrain


 Share

Recommended Posts

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

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

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

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

  • 3 weeks later...
  • 2 weeks later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...