diff options
Diffstat (limited to 'src/net/java/joglutils/msg/elements/ModelMatrixElement.java')
-rw-r--r-- | src/net/java/joglutils/msg/elements/ModelMatrixElement.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/java/joglutils/msg/elements/ModelMatrixElement.java b/src/net/java/joglutils/msg/elements/ModelMatrixElement.java index cfe726e..e4cdbb0 100644 --- a/src/net/java/joglutils/msg/elements/ModelMatrixElement.java +++ b/src/net/java/joglutils/msg/elements/ModelMatrixElement.java @@ -50,13 +50,21 @@ public class ModelMatrixElement extends Element { public Element newInstance() { return new ModelMatrixElement(); } + /** Returns the instance of this element in the passed State. */ public static ModelMatrixElement getInstance(State state) { return (ModelMatrixElement) state.getElement(index); } + /** Enables this element in the passed state, which should be the + default for a given action. */ public static void enable(State defaultState) { Element tmp = new ModelMatrixElement(); defaultState.setElement(tmp.getStateIndex(), tmp); } + /** Indicates whether this element is enabled in the given default + state for a particular action. */ + public static boolean isEnabled(State state) { + return (state.getDefaults().getElement(index) != null); + } // The matrix data protected Mat4f matrix; |