public void captureState() { MuscleBehavior movingMuscle = MuscleController.getMuscle("MovingMuscleDynamic"); if (movingMuscle != null) { muscleForce = movingMuscle.getForce(); } if (MuscleController.MovingTarget != null) { movingTargetPosition = MuscleController.MovingTarget.Offset; } ControlPointBehavior leftCP = ControlPointController.getControlPoint("LeftCP"); ControlPointBehavior rightCP = ControlPointController.getControlPoint("RightCP"); if (leftCP != null) { leftCPPosition = leftCP.CurrentLocation; } if (rightCP != null) { rightCPPosition = rightCP.CurrentLocation; } //Setup the pelvis fk chain if available FKRoot pelvis; if (PoseableObjectsManager.tryGetFkChainRoot("Pelvis", out pelvis)) { pelvisChainState = new FKChainState(); pelvis.addToChainState(pelvisChainState); } else { pelvisChainState = null; } }
internal static void addMuscle(String name, MuscleBehavior muscle) { muscles.Add(name, muscle); }