MinieLibrary/src/main/java/com/jme3/bullet/animation/RagUtils.java
/**
     * Validate an Armature for use with DynamicAnimControl.
     *
     * @param armature the Armature to validate (not null, unaffected)
     */
Validate an Armature for use with DynamicAnimControl.

@param armature the Armature to validate (not null, unaffected)
Validate an Armature for use with DynamicAnimControl . @param armature the Armature to validate ( not null unaffected )
public static void validate(Armature armature) {
        int numJoints = armature.getJointCount();
        if (numJoints < 0) {
            throw new IllegalArgumentException("Joint count is negative!");
        }
        Set<String> nameSet = new TreeSet<>();
        for (int jointIndex = 0; jointIndex < numJoints; ++jointIndex) {
            Joint joint = armature.getJoint(jointIndex);
            if (joint == null) {
                String msg = String.format("Joint %d in armature is null!",
                        jointIndex);
                throw new IllegalArgumentException(msg);
            }
            String jointName = joint.getName();
            if (jointName == null) {
                String message = String.format(
                        "Joint %d in armature has null name!", jointIndex);
                throw new IllegalArgumentException(message);
            } else if (jointName.equals(DynamicAnimControl.torsoName)) {
                String message = String.format(
                        "Joint %d in armature has a reserved name!",
                        jointIndex);
                throw new IllegalArgumentException(message);
            } else if (nameSet.contains(jointName)) {
                String message
                        = "Duplicate joint name in skeleton: " + jointName;
                throw new IllegalArgumentException(message);
            }
            nameSet.add(jointName);
        }
    }
public static void validate ( Armature armature ) { int numJoints = armature . getJointCount ( ) ; if ( numJoints < 0 ) { throw new IllegalArgumentException ( "Joint count is negative!" ) ; } Set < String > nameSet = new TreeSet < > ( ) ; for ( int jointIndex = 0 ; jointIndex < numJoints ; ++ jointIndex ) { Joint joint = armature . getJoint ( jointIndex ) ; if ( joint == null ) { String msg = String . format ( "Joint %d in armature is null!" , jointIndex ) ; throw new IllegalArgumentException ( msg ) ; } String jointName = joint . getName ( ) ; if ( jointName == null ) { String message = String . format ( "Joint %d in armature has null name!" , jointIndex ) ; throw new IllegalArgumentException ( message ) ; } else if ( jointName . equals ( DynamicAnimControl . torsoName ) ) { String message = String . format ( "Joint %d in armature has a reserved name!" , jointIndex ) ; throw new IllegalArgumentException ( message ) ; } else if ( nameSet . contains ( jointName ) ) { String message = "Duplicate joint name in skeleton: " + jointName ; throw new IllegalArgumentException ( message ) ; } nameSet . add ( jointName ) ; } }
Validate an Armature for use with DynamicAnimControl.
Validate an Armature for use with DynamicAnimControl .