From d729bbc43a6a4a73b7be0b44d0843073c9b544f6 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Wed, 6 Feb 2013 03:16:50 +0000 Subject: [PATCH] - fix missing material in debug state git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10354 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/bullet/debug/BulletCharacterDebugControl.java | 4 +--- .../jme3/bullet/debug/BulletGhostObjectDebugControl.java | 9 ++++----- .../jme3/bullet/debug/BulletRigidBodyDebugControl.java | 4 +--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/engine/src/bullet-common/com/jme3/bullet/debug/BulletCharacterDebugControl.java b/engine/src/bullet-common/com/jme3/bullet/debug/BulletCharacterDebugControl.java index 5e7f7bbd6..43c1cfd36 100644 --- a/engine/src/bullet-common/com/jme3/bullet/debug/BulletCharacterDebugControl.java +++ b/engine/src/bullet-common/com/jme3/bullet/debug/BulletCharacterDebugControl.java @@ -31,10 +31,7 @@ */ package com.jme3.bullet.debug; -import com.jme3.bullet.collision.shapes.CapsuleCollisionShape; import com.jme3.bullet.collision.shapes.CollisionShape; -import com.jme3.bullet.collision.shapes.CylinderCollisionShape; -import com.jme3.bullet.collision.shapes.SphereCollisionShape; import com.jme3.bullet.objects.PhysicsCharacter; import com.jme3.bullet.util.DebugShapeFactory; import com.jme3.math.Quaternion; @@ -82,6 +79,7 @@ public class BulletCharacterDebugControl extends AbstractPhysicsDebugControl { Node node = (Node) this.spatial; node.detachChild(geom); geom = DebugShapeFactory.getDebugShape(body.getCollisionShape()); + geom.setMaterial(debugAppState.DEBUG_PINK); node.attachChild(geom); } applyPhysicsTransform(body.getPhysicsLocation(location), Quaternion.IDENTITY); diff --git a/engine/src/bullet-common/com/jme3/bullet/debug/BulletGhostObjectDebugControl.java b/engine/src/bullet-common/com/jme3/bullet/debug/BulletGhostObjectDebugControl.java index 88da19e4f..d346c53c4 100644 --- a/engine/src/bullet-common/com/jme3/bullet/debug/BulletGhostObjectDebugControl.java +++ b/engine/src/bullet-common/com/jme3/bullet/debug/BulletGhostObjectDebugControl.java @@ -31,10 +31,7 @@ */ package com.jme3.bullet.debug; -import com.jme3.bullet.collision.shapes.CapsuleCollisionShape; import com.jme3.bullet.collision.shapes.CollisionShape; -import com.jme3.bullet.collision.shapes.CylinderCollisionShape; -import com.jme3.bullet.collision.shapes.SphereCollisionShape; import com.jme3.bullet.objects.PhysicsGhostObject; import com.jme3.bullet.util.DebugShapeFactory; import com.jme3.math.Quaternion; @@ -48,7 +45,8 @@ import com.jme3.scene.Spatial; * * @author normenhansen */ -public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl{ +public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl { + protected final PhysicsGhostObject body; protected final Vector3f location = new Vector3f(); protected final Quaternion rotation = new Quaternion(); @@ -79,10 +77,11 @@ public class BulletGhostObjectDebugControl extends AbstractPhysicsDebugControl{ @Override protected void controlUpdate(float tpf) { - if(myShape != body.getCollisionShape()){ + if (myShape != body.getCollisionShape()) { Node node = (Node) this.spatial; node.detachChild(geom); geom = DebugShapeFactory.getDebugShape(body.getCollisionShape()); + geom.setMaterial(debugAppState.DEBUG_YELLOW); node.attachChild(geom); } applyPhysicsTransform(body.getPhysicsLocation(location), Quaternion.IDENTITY); diff --git a/engine/src/bullet-common/com/jme3/bullet/debug/BulletRigidBodyDebugControl.java b/engine/src/bullet-common/com/jme3/bullet/debug/BulletRigidBodyDebugControl.java index de89ce24a..5656c58ee 100644 --- a/engine/src/bullet-common/com/jme3/bullet/debug/BulletRigidBodyDebugControl.java +++ b/engine/src/bullet-common/com/jme3/bullet/debug/BulletRigidBodyDebugControl.java @@ -31,10 +31,7 @@ */ package com.jme3.bullet.debug; -import com.jme3.bullet.collision.shapes.CapsuleCollisionShape; import com.jme3.bullet.collision.shapes.CollisionShape; -import com.jme3.bullet.collision.shapes.CylinderCollisionShape; -import com.jme3.bullet.collision.shapes.SphereCollisionShape; import com.jme3.bullet.objects.PhysicsRigidBody; import com.jme3.bullet.util.DebugShapeFactory; import com.jme3.math.Quaternion; @@ -83,6 +80,7 @@ public class BulletRigidBodyDebugControl extends AbstractPhysicsDebugControl { Node node = (Node) this.spatial; node.detachChild(geom); geom = DebugShapeFactory.getDebugShape(body.getCollisionShape()); + geom.setMaterial(debugAppState.DEBUG_BLUE); node.attachChild(geom); } applyPhysicsTransform(body.getPhysicsLocation(location), body.getPhysicsRotation(rotation));