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; } } }
internal ToothState(ToothState source) { this.name = source.name; this.extracted = source.extracted; this.offset = source.offset; this.rotation = source.rotation; }
public void addPosition(ToothState state) { if (teeth.ContainsKey(state.Name)) { teeth.Remove(state.Name); } teeth.Add(state.Name, state); }
public void blend(TeethState target, float percent) { foreach (String key in teeth.Keys) { ToothState start = teeth[key]; ToothState end = target.teeth[key]; start.blend(end, percent); } }