NodeMouseLook and AbsoluteMouse

Hi



i have some trouble using NodeMouseLook and AbsoluteMouse. jME 2



If I try it with RelativeMouse like this it works.


        RelativeMouse mouse = new RelativeMouse("mouse");
        mouse.registerWithInputHandler(input);

        NodeMouseLook mouseLook = new NodeMouseLook(mouse, camNode, 0.1f);
        mouseLook.setSpeed(0.1f);
        mouseLook.setLockAxis(new Vector3f(camNode.getLocalRotation().getRotationColumn(1).x,
              camNode.getLocalRotation().getRotationColumn(1).y,
              camNode.getLocalRotation().getRotationColumn(1).z));
        input.addAction(mouseLook);



but when I change it to AbsoluteMouse the camNode rotates itselfs


        mouse = new AbsoluteMouse("mouse", display.getWidth(), display.getHeight() );
       TextureState cursorTextureState = display.getRenderer().createTextureState();
        cursorTextureState.setTexture(
                TextureManager.loadTexture(
                        TestInputHandler.class.getClassLoader().getResource( "jmetest/data/cursor/cursor1.PNG" ),
                        Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear )
        );
               
        mouse.setRenderState(cursorTextureState);
        mouse.setRenderState(as1);
       
       mouse.registerWithInputHandler(input);
       rootNode.attachChild(mouse);

        NodeMouseLook mouseLook = new NodeMouseLook(mouse, camNode, 0.1f);
        mouseLook.setSpeed(0.1f);
        mouseLook.setLockAxis(new Vector3f(camNode.getLocalRotation().getRotationColumn(1).x,
              camNode.getLocalRotation().getRotationColumn(1).y,
              camNode.getLocalRotation().getRotationColumn(1).z));
        input.addAction(mouseLook);



Drake

Relative mouse means 'go off of what the mouse is doing'…



absolute means 'go off of where the mouse is at'…

ok, my fault :slight_smile:



I wanted the behavior of RelativeMouse with the cursor of the AbsoluteMouse.



So I'm going to use RelativeMouse and place a cursor myself.



mfg

Drake