gamecreator Posted June 14, 2015 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
macklebee Posted June 14, 2015 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
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.