jMonkeyEngine / jMonkeyEngine/sdk

Mouse Picking sometimes leads to a NPE

Open
#80 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SceneComposer
Dominant language
Java
Stars
348
Forks
104
Avg merge
4d 13h
Merged PRs (30d)
3

Description

I don't know what I did, I just tried to use the Scene Composer with this lousy touchpad and then... bam!

java.lang.NullPointerException
    at com.jme3.math.Vector3f.subtract(Vector3f.java:683)
    at com.jme3.gde.scenecomposer.tools.PickManager.getTranslation(PickManager.java:176)
    at com.jme3.gde.scenecomposer.tools.PickManager.getTranslation(PickManager.java:186)
    at com.jme3.gde.scenecomposer.tools.shortcuts.MoveShortcut.mouseMoved(MoveShortcut.java:160)
    at com.jme3.gde.scenecomposer.SceneComposerToolController.doEditToolMoved(SceneComposerToolController.java:218)
    at com.jme3.gde.scenecomposer.ComposerCameraController.checkMoved(ComposerCameraController.java:105)
    at com.jme3.gde.core.scene.controller.AbstractCameraController.update(AbstractCameraController.java:514)

It doesn't know the end position

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in jme3-gde/scenecomposer/tools/PickManager.java at getTranslation lines 176 and 186, then trace the call from MoveShortcut.mouseMoved. Reproduce mouse picking in the Scene Composer with the touchpad scenario described and inspect how the missing end position reaches Vector3f.subtract. Done means the interaction no longer produces this NullPointerException when the end position is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.