Event receivers, and selectable meshes.
Event receivers, and selectable meshes.
Hello all, I've been playing around with the tutorials, and this engine really seems simple! I'm amazed, but simple as it is, I don't have enough experience coding to think of solutions to even simple problems. I'll get there. I've gone through and understood the easy tutorials, up to the collision. What I'd like to do would build on the code in this tutorial, but make the meshes selectable, and movable. eg. left click and it tags the mesh selected, right click and it issues an order to move there. For now I'd be satisfied that if I left click on a mesh it uses a createFlyStraightAnimator to a set of coordinates. I'm supposing I need a pointer to a selected scene node, so at the top, under the camera scenenode I put "scene::ISceneNode* selected = 0;" I also suppose I need to use the event receiver to get mouse button events? This is where I get unsure of things. Do I write it like this "if (camera != 0 && event.EventType == irr::EET_MOUSE_INPUT_EVENT&& !event.MouseInput.PressedDown)"? Also it then needs a switch right? Do I use KEY_LBUTTON or EMIE_LMOUSE_PRESSED_DOWN? I'm not sure when and where to use these. I'm just modifying and mixing the tutorials code to get used to things as you may have noticed. Also, for the switch would switch(event.MouseInput.Key) work? or is it something like (event.MouseInput.Button)? I'm thinking .Key from what I've seen in the examples and docs, but then I'm not sure. Thank you all in advance for any insights.
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida