i have a running scene and by clicking on a Spatial i want to move its position with my mouse and after clicking one more time it should be set at the new position.
I know it is difficult to position something in a 3D-Scene only with the mouse, but to get the complete right position i want to set up the cam in the middle on top (like its 2D from Top) and set the height-position of the spatial by a second cam-view or something else. The first thing to get a solution for my problem would be, just to move the spatial with dragging by the mouse.
Fire a ray in an actionlistener when the mouse is pressed, save the spatial that was hit. Then in an analoglistener, listen for mouse move events, and move the spatial (if one is selected). When u let go of the mouse, set the selected spatial variable to null.
thanks for your answer. Getting the hitted Spatial runs. But then I have the problem, that I need to identify it. I have a list with all my Spatials and i want to know which of it was hitted. I can move the Spatial and change its size e.g., but the parameter tmpSpatial.getName() doesn´t give me the right “key”. If I use a Geometry instead, the getName() parameter gives the setted Name.