public void update() { boneState = MandibleController.createMandibleState(); discState = DiscController.createDiscState(); teethState = TeethController.createTeethState(); fossaState = FossaController.createState(); }
public void blend(ToothState end, float percent) { Tooth tooth = TeethController.getTooth(name); if (tooth != null) { tooth.Extracted = this.Extracted; Vector3 offset = this.offset.lerp(ref end.offset, ref percent); if (offset.isNumber()) { tooth.Offset = offset; } else { //Log.Debug("Got a non numerical offset for tooth {0} time {1}", Name, percent); tooth.Offset = end.offset; } Quaternion rotation = this.rotation.slerp(ref end.rotation, percent); if (rotation.isNumber()) { tooth.Rotation = rotation; } else { //Log.Debug("Got a non numerical rotation for tooth {0} time {1}", Name, percent); tooth.Rotation = end.rotation; } } }
protected override void constructed() { sceneNodeElement = Owner.getElement(sceneNodeName) as SceneNodeElement; if (sceneNodeElement == null) { blacklist("Could not find SceneNodeElement {0}.", sceneNodeName); } entity = sceneNodeElement.getNodeObject(entityName) as Entity; if (entity == null) { blacklist("Could not find Entity {0}.", entityName); } actorElement = Owner.getElement(actorName) as RigidBody; if (actorElement == null) { blacklist("Could not find Actor {0}.", actorName); } SleepyActorRepository.addSleeper(actorElement); joint = Owner.getElement(jointName) as Generic6DofConstraintElement; if (joint == null) { blacklist("Could not find Joint {0}.", jointName); } startingLocation = joint.getFrameOffsetOriginA(); startingRotation = joint.getFrameOffsetBasisA(); transparency = Owner.getElement(transparencyInterface) as TransparencyInterface; if (transparency == null) { blacklist("Could not find TransparencyInterface {0}", transparencyInterface); } TeethController.addTooth(Owner.Name, this); HighlightColor = Color.White; }
protected override void destroy() { TeethController.removeTooth(Owner.Name); SleepyActorRepository.removeSleeper(actorElement); }