jMonkeyEngine / jMonkeyEngine/sdk

Picking sometimes fails

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

Nobody has claimed this yet.

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

Description

The issue is that null values make their way into start/finish picLocs.
I suspect this is when you start picking (pressing g in my case) when the cursor is outside of the window (or maybe the cursor is on top of another panel).

java.lang.NullPointerException
	at com.jme3.math.Vector3f.subtract(Vector3f.java:683)
	at com.jme3.gde.scenecomposer.tools.PickManager.getTranslation(PickManager.java:185)
	at com.jme3.gde.scenecomposer.tools.PickManager.getTranslation(PickManager.java:195)
	at com.jme3.gde.scenecomposer.tools.shortcuts.MoveShortcut.mouseMoved(MoveShortcut.java:160)
	at com.jme3.gde.scenecomposer.SceneComposerToolController.doEditToolMoved(SceneComposerToolController.java:239)
	at com.jme3.gde.scenecomposer.ComposerCameraController.checkMoved(ComposerCameraController.java:105)
	at com.jme3.gde.core.scene.controller.AbstractCameraController.update(AbstractCameraController.java:514)
	at com.jme3.app.state.AppStateManager.update(AppStateManager.java:287)
[catch] at com.jme3.gde.core.scene.SceneApplication.update(SceneApplication.java:305)
	at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:200)
	at com.jme3.system.awt.AwtPanelsContext.access$100(AwtPanelsContext.java:45)
	at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:69)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:125)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:156)
	at java.lang.Thread.run(Thread.java:748)

If someone is bored and wants to try it out, a way to reproduce this would help fixing it (because just ignoring this exception does not really help)

Edit: This seems to choke the sdk though, I've had this exception multiple times, however could recover. Not sure what happens there :/

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 PickManager.java at getTranslation, then follow the call from MoveShortcut.java mouseMoved shown in the stack trace. Reproduce picking with the cursor outside the window or over another panel and inspect how null start/finish picLocs arise. Done means picking no longer throws the reported NullPointerException and the SDK remains usable afterward.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.