MinieLibrary/src/main/java/com/jme3/bullet/MultiBody.java
/**
     * Configure a new link that's a copy of the specified link, except it's
     * part of this MultiBody.
     *
     * @param original (not null, unaffected)
     * @return a new link of the same type
     */
Configure a new link that's a copy of the specified link, except it's
part of this MultiBody.

@param original (not null, unaffected)
@return a new link of the same type
Configure a new link that ' s a copy of the specified link except it ' s part of this MultiBody . @param original ( not null unaffected ) @return a new link of the same type
private MultiBodyLink configureClonedLink(MultiBodyLink original) {
        MultiBodyJointType jointType = original.jointType();
        float mass = original.mass();
        Vector3f inertia = original.inertia(null);
        Quaternion orientation = original.orientation(null);
        boolean disableCollision = !original.isCollisionWithParent();
        MultiBodyLink origParent = original.getParentLink();
        MultiBodyLink parent = null;
        if (origParent != null) {
            int parentIndex = origParent.index();
            parent = links[parentIndex];
        }
        Vector3f axis, parent2Link, parent2Pivot, pivot2Link;
        MultiBodyLink result;
        switch (jointType) {
            case Fixed:
                assert disableCollision == true;
                parent2Pivot = original.parent2Pivot(null);
                pivot2Link = original.pivot2Link(null);
                result = configureFixedLink(mass, inertia, parent, orientation,
                        parent2Pivot, pivot2Link);
                break;
            case Planar:
                axis = original.axis(null);
                parent2Link = original.parent2Link(null);
                result = configurePlanarLink(mass, inertia, parent, orientation,
                        axis, parent2Link, disableCollision);
                break;
            case Prismatic:
                axis = original.axis(null);
                parent2Pivot = original.parent2Pivot(null);
                pivot2Link = original.pivot2Link(null);
                result = configurePrismaticLink(mass, inertia, parent,
                        orientation, axis, parent2Pivot, pivot2Link,
                        disableCollision);
                break;
            case Revolute:
                axis = original.axis(null);
                parent2Pivot = original.parent2Pivot(null);
                pivot2Link = original.pivot2Link(null);
                result = configureRevoluteLink(mass, inertia, parent,
                        orientation, axis, parent2Pivot, pivot2Link,
                        disableCollision);
                break;
            case Spherical:
                parent2Pivot = original.parent2Pivot(null);
                pivot2Link = original.pivot2Link(null);
                result = configureSphericalLink(mass, inertia, parent,
                        orientation, parent2Pivot, pivot2Link,
                        disableCollision);
                break;
            default:
                throw new IllegalStateException("jointType = " + jointType);
        }
        return result;
    }
private MultiBodyLink configureClonedLink ( MultiBodyLink original ) { MultiBodyJointType jointType = original . jointType ( ) ; float mass = original . mass ( ) ; Vector3f inertia = original . inertia ( null ) ; Quaternion orientation = original . orientation ( null ) ; boolean disableCollision = ! original . isCollisionWithParent ( ) ; MultiBodyLink origParent = original . getParentLink ( ) ; MultiBodyLink parent = null ; if ( origParent != null ) { int parentIndex = origParent . index ( ) ; parent = links [ parentIndex ] ; } Vector3f axis , parent2Link , parent2Pivot , pivot2Link ; MultiBodyLink result ; switch ( jointType ) { case Fixed : assert disableCollision == true ; parent2Pivot = original . parent2Pivot ( null ) ; pivot2Link = original . pivot2Link ( null ) ; result = configureFixedLink ( mass , inertia , parent , orientation , parent2Pivot , pivot2Link ) ; break ; case Planar : axis = original . axis ( null ) ; parent2Link = original . parent2Link ( null ) ; result = configurePlanarLink ( mass , inertia , parent , orientation , axis , parent2Link , disableCollision ) ; break ; case Prismatic : axis = original . axis ( null ) ; parent2Pivot = original . parent2Pivot ( null ) ; pivot2Link = original . pivot2Link ( null ) ; result = configurePrismaticLink ( mass , inertia , parent , orientation , axis , parent2Pivot , pivot2Link , disableCollision ) ; break ; case Revolute : axis = original . axis ( null ) ; parent2Pivot = original . parent2Pivot ( null ) ; pivot2Link = original . pivot2Link ( null ) ; result = configureRevoluteLink ( mass , inertia , parent , orientation , axis , parent2Pivot , pivot2Link , disableCollision ) ; break ; case Spherical : parent2Pivot = original . parent2Pivot ( null ) ; pivot2Link = original . pivot2Link ( null ) ; result = configureSphericalLink ( mass , inertia , parent , orientation , parent2Pivot , pivot2Link , disableCollision ) ; break ; default : throw new IllegalStateException ( "jointType = " + jointType ) ; } return result ; }
Configure a new link that's a copy of the specified link, except it's
 part of this MultiBody.
Configure a new link that ' s a copy of the specified link except it ' s part of this MultiBody .