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:
@@ -37,6 +37,7 @@ import java.nio.MappedByteBuffer;
|
|||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
@@ -738,8 +739,12 @@ public class Model extends ModelNode
|
|||||||
*/
|
*/
|
||||||
public void lockInstance ()
|
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>();
|
HashSet<Spatial> targets = new HashSet<Spatial>();
|
||||||
|
for (String aname : getAnimationNames()) {
|
||||||
|
Collections.addAll(targets, getAnimation(aname).transformTargets);
|
||||||
|
}
|
||||||
for (Object ctrl : getControllers()) {
|
for (Object ctrl : getControllers()) {
|
||||||
if (ctrl instanceof ModelController) {
|
if (ctrl instanceof ModelController) {
|
||||||
targets.add(((ModelController)ctrl).getTarget());
|
targets.add(((ModelController)ctrl).getTarget());
|
||||||
|
|||||||
Reference in New Issue
Block a user