Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions jme3-core/src/main/java/com/jme3/anim/AnimComposer.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,30 @@ public Action setCurrentAction(String actionName, String layerName) {
return currentAction;
}

public Action getCurrentAction(String name) {
return getCurrentAction(name, DEFAULT_LAYER);
}

/**
* Return current action on specified layer.
*
* @param actionName The name of the action to run.
* @param layerName The layer on which action should run.
* @return The action corresponding to the given name.
*/
public Action getCurrentAction(String actionName, String layerName) {
Layer l = layers.get(layerName);
if (l == null) {
throw new IllegalArgumentException("Unknown layer " + layerName);
}

return l.currentAction;
}

public void removeCurrentAction() {
removeCurrentAction(DEFAULT_LAYER);
}

/**
* Remove current action on specified layer.
*
Expand All @@ -140,6 +164,10 @@ public void removeCurrentAction(String layerName) {
l.currentAction = null;
}

public double getTime() {
return getTime(DEFAULT_LAYER);
}

/**
* Returns current time of the specified layer.
*/
Expand All @@ -150,6 +178,10 @@ public double getTime(String layerName) {
}
return l.time;
}

public void setTime(double time) {
setTime(DEFAULT_LAYER, time);
}

/**
* Sets current time on the specified layer.
Expand Down