protected override void constructed() { DiscController.addDisc(this); SimObject controlPointObj = Owner.getOtherSimObject(controlPointObject); if (controlPointObj != null) { controlPoint = controlPointObj.getElement(controlPointBehavior) as ControlPointBehavior; if (controlPoint == null) { blacklist("Could not find controlPointBehavior {0}.", controlPointBehavior); } } else { blacklist("Could not find controlPointObject {0}.", controlPointObject); } SimObject fossaSimObject = Owner.getOtherSimObject(fossaObject); if (fossaSimObject != null) { fossa = fossaSimObject.getElement(fossaName) as Fossa; if (fossa == null) { blacklist("Could not find Fossa {0} in SimObject {1}.", fossaName, fossaObject); } } else { blacklist("Could not find Fossa SimObject {0}.", fossaObject); } SceneNodeElement node = Owner.getElement(sceneNodeName) as SceneNodeElement; if (node != null) { Entity entity = node.getNodeObject(entityName) as Entity; if (entity != null) { if (entity.hasSkeleton()) { SkeletonInstance skeleton = entity.getSkeleton(); medialPole.findBone(skeleton); lateralPole.findBone(skeleton); ventralPole.findBone(skeleton); posteriorPole.initialize(skeleton, Owner, controlPoint, this); topSurface.initialize(skeleton, fossa, Owner); } } else { blacklist("Could not find entity {0} in node {1}.", entityName, sceneNodeName); } } else { blacklist("Could not find SceneNode {0}.", sceneNodeName); } }
public void blend(FossaState target, float percent) { foreach (String key in positions.Keys) { Fossa fossa = FossaController.get(key); if (fossa != null) { float start = positions[key]; float end = target.positions[key]; float delta = end - start; fossa.setEminanceDistortion(start + delta * percent); } } }
public void initialize(Skeleton skeleton, Fossa fossa, SimObject owner) { this.fossa = fossa; this.owner = owner; float current = boneStartOffset; for (int i = 1; skeleton.hasBone(boneBaseName + i); ++i) { Bone bone = skeleton.getBone(boneBaseName + i); bone.setManuallyControlled(true); bones.Add(new DiscBonePair(bone, current)); current += boneDelta; } followSimObject = owner.getOtherSimObject(followSimObjectName); //if (boneBaseName == "RightEmenence") //{ // SceneNodeElement node = owner.getElement("Node") as SceneNodeElement; // Entity entity = node.getNodeObject("Entity") as Entity; // entity.setDisplaySkeleton(true); //} }
public static void remove(Fossa fossa) { fossas.Remove(fossa.Owner.Name); }
public static void add(Fossa fossa) { fossas.Add(fossa.Owner.Name, fossa); }