src/main/java/com/jme3/bullet/util/DebugShapeFactory.java
/**
     * Generate vertex locations for triangles to visualize the specified
     * CompoundCollisionShape.
     *
     * @param compoundShape (not null, unaffected)
     * @param meshResolution (0=low, 1=high)
     *
     * @return a new, unflipped, direct buffer full of scaled shape coordinates
     * (capacity a multiple of 9)
     */
Generate vertex locations for triangles to visualize the specified
CompoundCollisionShape.

@param compoundShape (not null, unaffected)
@param meshResolution (0=low, 1=high)

@return a new, unflipped, direct buffer full of scaled shape coordinates
(capacity a multiple of 9)
Generate vertex locations for triangles to visualize the specified CompoundCollisionShape . @param compoundShape ( not null unaffected ) @param meshResolution ( 0 = low 1 = high ) @return a new unflipped direct buffer full of scaled shape coordinates ( capacity a multiple of 9 )
private static FloatBuffer createCompoundTriangles(
            CompoundCollisionShape compoundShape, int meshResolution) {
        ChildCollisionShape[] children = compoundShape.listChildren();
        int numChildren = children.length;
        FloatBuffer[] bufferArray = new FloatBuffer[numChildren];
        Transform tmpTransform = new Transform();
        int totalFloats = 0;
        for (int childIndex = 0; childIndex < numChildren; ++childIndex) {
            ChildCollisionShape childShape = children[childIndex];
            CollisionShape shape = childShape.getShape();
            childShape.copyTransform(tmpTransform);
            FloatBuffer buffer = getDebugTriangles(shape, meshResolution);
            int numFloats = buffer.capacity();
            MyBuffer.transform(buffer, 0, numFloats, tmpTransform);
            bufferArray[childIndex] = buffer;
            totalFloats += numFloats;
        }
        FloatBuffer result = BufferUtils.createFloatBuffer(totalFloats);
        for (FloatBuffer buffer : bufferArray) {
            for (int position = 0; position < buffer.capacity(); ++position) {
                float value = buffer.get(position);
                result.put(value);
            }
        }
        assert result.position() == result.capacity();
        return result;
    }
private static FloatBuffer createCompoundTriangles ( CompoundCollisionShape compoundShape , int meshResolution ) { ChildCollisionShape [ ] children = compoundShape . listChildren ( ) ; int numChildren = children . length ; FloatBuffer [ ] bufferArray = new FloatBuffer [ numChildren ] ; Transform tmpTransform = new Transform ( ) ; int totalFloats = 0 ; for ( int childIndex = 0 ; childIndex < numChildren ; ++ childIndex ) { ChildCollisionShape childShape = children [ childIndex ] ; CollisionShape shape = childShape . getShape ( ) ; childShape . copyTransform ( tmpTransform ) ; FloatBuffer buffer = getDebugTriangles ( shape , meshResolution ) ; int numFloats = buffer . capacity ( ) ; MyBuffer . transform ( buffer , 0 , numFloats , tmpTransform ) ; bufferArray [ childIndex ] = buffer ; totalFloats += numFloats ; } FloatBuffer result = BufferUtils . createFloatBuffer ( totalFloats ) ; for ( FloatBuffer buffer : bufferArray ) { for ( int position = 0 ; position < buffer . capacity ( ) ; ++ position ) { float value = buffer . get ( position ) ; result . put ( value ) ; } } assert result . position ( ) == result . capacity ( ) ; return result ; }
Generate vertex locations for triangles to visualize the specified
 CompoundCollisionShape.
Generate vertex locations for triangles to visualize the specified CompoundCollisionShape .