Actually, I took a demo program (called "playground") that combined OPAL physics and OGRE graphics, and just changed the code and added lots of my own to make this program.
That picking-up ability was already coded into the demo, so I just used it without having a close look at how it was done. I think (though I'm not 100% sure) it uses a ray sensor to find the point on the surface directly ahead, and then some kind of spring line connected to a tiny sphere that says in front of the camera.
Minor correction: the "tiny sphere" in front of the camera is actually an overlay (so it won't get obscured). The spring line must just connect to some point in space that stays in front of the camera (at a distance determined when the object is first picked up).
Actually, I took a demo program (called "playground") that combined OPAL physics and OGRE graphics, and just changed the code and added lots of my own to make this program.
That picking-up ability was already coded into the demo, so I just used it without having a close look at how it was done. I think (though I'm not 100% sure) it uses a ray sensor to find the point on the surface directly ahead, and then some kind of spring line connected to a tiny sphere that says in front of the camera.
kjlg74 3 years ago
haha.pretty good.How did you implement picking objects? Did you use rays?
mpeniak 3 years ago
Minor correction: the "tiny sphere" in front of the camera is actually an overlay (so it won't get obscured). The spring line must just connect to some point in space that stays in front of the camera (at a distance determined when the object is first picked up).
kjlg74 3 years ago