Package jme3utilities

Class MyControl

java.lang.Object
jme3utilities.MyControl

public class MyControl extends Object
Utility methods that operate on jME3 scene-graph controls in general. If physics controls might be present, use the corresponding methods in the MyControlP class instead.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    canDisable(com.jme3.scene.control.Control sgc)
    Check whether a scene-graph control implements isEnabled() and setEnabled().
    static String
    describe(com.jme3.scene.control.Control control)
    Generate a textual description of the specified scene-graph control.
    static String
    describeType(com.jme3.scene.control.Control control)
    Describe the type of a scene-graph control.
    static int
    findIndex(com.jme3.scene.control.Control sgc, com.jme3.scene.Spatial spatial)
    Find the index of the specified scene-graph control in the specified spatial.
    static com.jme3.animation.Skeleton
    findSkeleton(com.jme3.scene.control.Control sgc)
    Access the skeleton (if any) in the specified scene-graph control.
    static boolean
    isEnabled(com.jme3.scene.control.Control sgc)
    Test whether the specified scene-graph control is enabled.
    static void
    setEnabled(com.jme3.scene.control.Control sgc, boolean newState)
    Alter the enabled state of a scene-graph control.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • canDisable

      public static boolean canDisable(com.jme3.scene.control.Control sgc)
      Check whether a scene-graph control implements isEnabled() and setEnabled().
      Parameters:
      sgc - control to test (may be null, unaffected)
      Returns:
      true if it's implemented, otherwise false
    • describe

      public static String describe(com.jme3.scene.control.Control control)
      Generate a textual description of the specified scene-graph control.
      Parameters:
      control - the instance to describe (not null, unaffected)
      Returns:
      a description (not null, not empty)
    • describeType

      public static String describeType(com.jme3.scene.control.Control control)
      Describe the type of a scene-graph control.
      Parameters:
      control - instance to describe (not null, unaffected)
      Returns:
      description (not null)
    • findIndex

      public static int findIndex(com.jme3.scene.control.Control sgc, com.jme3.scene.Spatial spatial)
      Find the index of the specified scene-graph control in the specified spatial.
      Parameters:
      sgc - scene-graph control to find (not null, unaffected)
      spatial - where the control was added (not null, unaffected)
      Returns:
      index (≥0) or -1 if not found
    • findSkeleton

      public static com.jme3.animation.Skeleton findSkeleton(com.jme3.scene.control.Control sgc)
      Access the skeleton (if any) in the specified scene-graph control.
      Parameters:
      sgc - which scene-graph control (may be null, unaffected)
      Returns:
      the pre-existing instance, or null if none found
    • isEnabled

      public static boolean isEnabled(com.jme3.scene.control.Control sgc)
      Test whether the specified scene-graph control is enabled.
      Parameters:
      sgc - the control to test (not null, unaffected)
      Returns:
      true if the control is enabled, otherwise false
    • setEnabled

      public static void setEnabled(com.jme3.scene.control.Control sgc, boolean newState)
      Alter the enabled state of a scene-graph control.
      Parameters:
      sgc - control to alter (not null)
      newState - true means enable the control, false means disable it