com.jmex.physics
Class PhysicsDebugger

java.lang.Object
  extended by com.jmex.physics.PhysicsDebugger

public class PhysicsDebugger
extends java.lang.Object

Analoguous to Debugger this class can be used to view physics data such as physics collision bounds, velocity and forces.

Author:
Irrisor

Field Summary
static com.jme.renderer.ColorRGBA COLOR_ACTIVE
           
static com.jme.renderer.ColorRGBA COLOR_ACTIVE_RESTING
           
static com.jme.renderer.ColorRGBA COLOR_CENTER
           
static com.jme.renderer.ColorRGBA COLOR_CENTER_OF_MASS
           
static com.jme.renderer.ColorRGBA COLOR_INACTIVE
           
static com.jme.renderer.ColorRGBA COLOR_JOINT
           
 
Constructor Summary
protected PhysicsDebugger()
           
 
Method Summary
static void drawArrow(com.jme.math.Vector3f from, com.jme.math.Vector3f to, com.jme.renderer.ColorRGBA color, com.jme.renderer.Renderer renderer)
          Draws an arrow in specified color.
static void drawCross(com.jme.math.Vector3f center, float length, com.jme.renderer.Renderer renderer, com.jme.renderer.ColorRGBA color, int lineWidth)
           
static void drawDebugShape(com.jme.scene.Spatial debugShape, com.jme.math.Vector3f geometryPivot, PhysicsCollisionGeometry geometry, com.jme.renderer.Renderer renderer, float approximateVisualSize)
           
static void drawPhysics(PhysicsCollisionGeometry physicsCollisionGeometry, com.jme.renderer.Renderer renderer)
          Draw all info available for the physics geometry.
static void drawPhysics(PhysicsNode physicsNode, com.jme.renderer.Renderer renderer)
          Draw all info available for the physics node.
static void drawPhysics(PhysicsSpace space, com.jme.renderer.Renderer renderer)
          Draw all info available for the physics nodes in the specified space.
static void setupDebugGeom(com.jme.scene.Geometry debugShape)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR_ACTIVE

public static final com.jme.renderer.ColorRGBA COLOR_ACTIVE

COLOR_ACTIVE_RESTING

public static final com.jme.renderer.ColorRGBA COLOR_ACTIVE_RESTING

COLOR_INACTIVE

public static final com.jme.renderer.ColorRGBA COLOR_INACTIVE

COLOR_CENTER

public static final com.jme.renderer.ColorRGBA COLOR_CENTER

COLOR_CENTER_OF_MASS

public static final com.jme.renderer.ColorRGBA COLOR_CENTER_OF_MASS

COLOR_JOINT

public static final com.jme.renderer.ColorRGBA COLOR_JOINT
Constructor Detail

PhysicsDebugger

protected PhysicsDebugger()
Method Detail

drawPhysics

public static void drawPhysics(PhysicsSpace space,
                               com.jme.renderer.Renderer renderer)
Draw all info available for the physics nodes in the specified space.

Parameters:
space - what to draw info for
renderer - where to draw

drawPhysics

public static void drawPhysics(PhysicsNode physicsNode,
                               com.jme.renderer.Renderer renderer)
Draw all info available for the physics node.

Parameters:
physicsNode - what to draw info for
renderer - where to draw

drawPhysics

public static void drawPhysics(PhysicsCollisionGeometry physicsCollisionGeometry,
                               com.jme.renderer.Renderer renderer)
Draw all info available for the physics geometry.

Parameters:
physicsCollisionGeometry - what to draw info for
renderer - where to draw

drawDebugShape

public static void drawDebugShape(com.jme.scene.Spatial debugShape,
                                  com.jme.math.Vector3f geometryPivot,
                                  PhysicsCollisionGeometry geometry,
                                  com.jme.renderer.Renderer renderer,
                                  float approximateVisualSize)

drawCross

public static void drawCross(com.jme.math.Vector3f center,
                             float length,
                             com.jme.renderer.Renderer renderer,
                             com.jme.renderer.ColorRGBA color,
                             int lineWidth)

drawArrow

public static void drawArrow(com.jme.math.Vector3f from,
                             com.jme.math.Vector3f to,
                             com.jme.renderer.ColorRGBA color,
                             com.jme.renderer.Renderer renderer)
Draws an arrow in specified color. Should be called directly _after_ drawDebugShape(com.jme.scene.Spatial, com.jme.math.Vector3f, com.jmex.physics.PhysicsCollisionGeometry, com.jme.renderer.Renderer, float) only!

Parameters:
from - starting point of the arrow
to - target point of the arrow
color - of the arrow
renderer - where to draw to

setupDebugGeom

public static void setupDebugGeom(com.jme.scene.Geometry debugShape)