gamecreator Posted June 14, 2015 Share Posted June 14, 2015 I would like to pick a model (ground, not a terrain, just a mesh) behind a model (box) but don't know how. Right now I have it set up like this: ground->SetCollisionType(Collision::Scene); box->SetCollisionType(Collision::None); Vec3 p = window->GetMousePosition(); if(window->MouseDown(1)) { if(camera->Pick(p.x, p.y, pickinfo, 0, true, Collision::Scene)) { box->SetPosition(pickinfo.position.x, 0, pickinfo.position.z); } } But it doesn't result in the box moving. However, if I remove Collision::Scene from the Pick function, it works (but also picks the box, which I don't want). I know I can hide the box before the pick and show it again after but I'm building a bigger level and I'm trying to avoid hiding/showing hundreds or thousands of elements. Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 14, 2015 Share Posted June 14, 2015 Set the box's pick mode to 0: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitysetpickmode-r135 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
gamecreator Posted June 15, 2015 Author Share Posted June 15, 2015 Thank you! 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.