Skip to content

Commit 4ad4736

Browse files
authored
Merge pull request #2531 from capdevon/capdevon-AramtureDebugState2
ArmatureDebugAppState: minor fix and improvements
2 parents 2ca556a + 4c8c500 commit 4ad4736

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected void initialize(Application app) {
121121
}
122122

123123
private void registerInput() {
124-
inputManager.addMapping(PICK_JOINT, new MouseButtonTrigger(MouseInput.BUTTON_LEFT), new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
124+
inputManager.addMapping(PICK_JOINT, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
125125
inputManager.addMapping(TOGGLE_JOINTS, new KeyTrigger(KeyInput.KEY_F10));
126126
inputManager.addListener(actionListener, PICK_JOINT, TOGGLE_JOINTS);
127127
}
@@ -248,6 +248,10 @@ private void collectGeometries(Node node, List<Geometry> geometries) {
248248

249249
@Override
250250
public void onAction(String name, boolean isPressed, float tpf) {
251+
if (!isEnabled()) {
252+
return;
253+
}
254+
251255
if (name.equals(PICK_JOINT)) {
252256
if (isPressed) {
253257
// Start counting click delay on mouse press
@@ -290,22 +294,24 @@ else if (name.equals(TOGGLE_JOINTS) && isPressed) {
290294
}
291295
}
292296

293-
private void printJointInfo(Joint selectedjoint, ArmatureDebugger ad) {
297+
private void printJointInfo(Joint selectedJoint, ArmatureDebugger ad) {
294298
if (enableJointInfoLogging) {
295-
System.err.println("-----------------------");
296-
System.err.println("Selected Joint : " + selectedjoint.getName() + " in armature " + ad.getName());
297-
System.err.println("Root Bone : " + (selectedjoint.getParent() == null));
298-
System.err.println("-----------------------");
299-
System.err.println("Local translation: " + selectedjoint.getLocalTranslation());
300-
System.err.println("Local rotation: " + selectedjoint.getLocalRotation());
301-
System.err.println("Local scale: " + selectedjoint.getLocalScale());
302-
System.err.println("---");
303-
System.err.println("Model translation: " + selectedjoint.getModelTransform().getTranslation());
304-
System.err.println("Model rotation: " + selectedjoint.getModelTransform().getRotation());
305-
System.err.println("Model scale: " + selectedjoint.getModelTransform().getScale());
306-
System.err.println("---");
307-
System.err.println("Bind inverse Transform: ");
308-
System.err.println(selectedjoint.getInverseModelBindMatrix());
299+
String info = "\n-----------------------\n" +
300+
"Selected Joint : " + selectedJoint.getName() + " in armature " + ad.getName() + "\n" +
301+
"Root Bone : " + (selectedJoint.getParent() == null) + "\n" +
302+
"-----------------------\n" +
303+
"Local translation: " + selectedJoint.getLocalTranslation() + "\n" +
304+
"Local rotation: " + selectedJoint.getLocalRotation() + "\n" +
305+
"Local scale: " + selectedJoint.getLocalScale() + "\n" +
306+
"---\n" +
307+
"Model translation: " + selectedJoint.getModelTransform().getTranslation() + "\n" +
308+
"Model rotation: " + selectedJoint.getModelTransform().getRotation() + "\n" +
309+
"Model scale: " + selectedJoint.getModelTransform().getScale() + "\n" +
310+
"---\n" +
311+
"Bind inverse Transform: \n" +
312+
selectedJoint.getInverseModelBindMatrix();
313+
314+
logger.log(Level.INFO, info);
309315
}
310316
}
311317

0 commit comments

Comments
 (0)