Exclude animation transform targets when locking immobile models.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@28 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2006-08-22 22:20:47 +00:00
parent a6aab0c177
commit 4a4f9755c8
+6 -1
View File
@@ -37,6 +37,7 @@ import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Properties;
@@ -738,8 +739,12 @@ public class Model extends ModelNode
*/
public void lockInstance ()
{
// collect the controller targets and lock recursively
// collect the instance's animation and controller targets and lock
// recursively
HashSet<Spatial> targets = new HashSet<Spatial>();
for (String aname : getAnimationNames()) {
Collections.addAll(targets, getAnimation(aname).transformTargets);
}
for (Object ctrl : getControllers()) {
if (ctrl instanceof ModelController) {
targets.add(((ModelController)ctrl).getTarget());