MinieLibrary/src/main/java/com/jme3/bullet/util/DebugShapeFactory.java
/**
     * Create a Node for visualizing the specified CompoundCollisionShape.
     *
     * @param compoundShape (not null, unaffected)
     * @param normals which normals to generate (not null)
     * @param resolution how much detail for convex child shapes (0=low, 1=high)
     * @return a new Node (not null)
     */
Create a Node for visualizing the specified CompoundCollisionShape.
@param compoundShape (not null, unaffected)
@param normals which normals to generate (not null)
@param resolution how much detail for convex child shapes (0=low, 1=high)
@return a new Node (not null)
Create a Node for visualizing the specified CompoundCollisionShape . @param compoundShape ( not null unaffected ) @param normals which normals to generate ( not null ) @param resolution how much detail for convex child shapes ( 0 = low 1 = high ) @return a new Node ( not null )
private static Node createNode(CompoundCollisionShape compoundShape,
            DebugMeshInitListener listener, DebugMeshNormals normals,
            int resolution) {
        assert normals != null;
        assert resolution >= lowResolution : resolution;
        assert resolution <= highResolution : resolution;
        Node node = new Node("Bullet debug");
        Vector3f scale = compoundShape.getScale(null);
        Matrix3f tmpRotation = new Matrix3f(); 
        Vector3f tmpOffset = new Vector3f();
        ChildCollisionShape[] children = compoundShape.listChildren();
        for (ChildCollisionShape child : children) {
            CollisionShape childShape = child.getShape();
            Geometry geometry = createGeometry(childShape, listener, normals,
                    resolution);
            child.copyOffset(tmpOffset);
            tmpOffset.multLocal(scale);
            geometry.setLocalTranslation(tmpOffset);
            child.copyRotationMatrix(tmpRotation);
            geometry.setLocalRotation(tmpRotation);
            node.attachChild(geometry);
        }
        node.updateGeometricState();
        return node;
    }
private static Node createNode ( CompoundCollisionShape compoundShape , DebugMeshInitListener listener , DebugMeshNormals normals , int resolution ) { assert normals != null ; assert resolution >= lowResolution : resolution ; assert resolution <= highResolution : resolution ; Node node = new Node ( "Bullet debug" ) ; Vector3f scale = compoundShape . getScale ( null ) ; Matrix3f tmpRotation = new Matrix3f ( ) ; Vector3f tmpOffset = new Vector3f ( ) ; ChildCollisionShape [ ] children = compoundShape . listChildren ( ) ; for ( ChildCollisionShape child : children ) { CollisionShape childShape = child . getShape ( ) ; Geometry geometry = createGeometry ( childShape , listener , normals , resolution ) ; child . copyOffset ( tmpOffset ) ; tmpOffset . multLocal ( scale ) ; geometry . setLocalTranslation ( tmpOffset ) ; child . copyRotationMatrix ( tmpRotation ) ; geometry . setLocalRotation ( tmpRotation ) ; node . attachChild ( geometry ) ; } node . updateGeometricState ( ) ; return node ; }
Create a Node for visualizing the specified CompoundCollisionShape.
Create a Node for visualizing the specified CompoundCollisionShape .
// TODO garbage // apply scaled offset // apply rotation