//========================================================================================= /// <summary> /// シミュレーションリセットAPIの内部実装 /// </summary> /// <param name="teleportMode"></param> /// <param name="resetStabilizationTime"></param> private void ResetClothInternal(ClothParams.TeleportMode teleportMode, float resetStabilizationTime) { if (IsValid()) { switch (teleportMode) { case ClothParams.TeleportMode.Reset: MagicaPhysicsManager.Instance.Team.SetFlag(teamId, PhysicsManagerTeamData.Flag_Reset_WorldInfluence, true); MagicaPhysicsManager.Instance.Team.SetFlag(teamId, PhysicsManagerTeamData.Flag_Reset_Position, true); MagicaPhysicsManager.Instance.Team.SetFlag(teamId, PhysicsManagerTeamData.Flag_Reset_Keep, false); MagicaPhysicsManager.Instance.Team.ResetStabilizationTime(teamId, resetStabilizationTime); break; case ClothParams.TeleportMode.Keep: MagicaPhysicsManager.Instance.Team.SetFlag(teamId, PhysicsManagerTeamData.Flag_Reset_WorldInfluence, false); MagicaPhysicsManager.Instance.Team.SetFlag(teamId, PhysicsManagerTeamData.Flag_Reset_Position, false); MagicaPhysicsManager.Instance.Team.SetFlag(teamId, PhysicsManagerTeamData.Flag_Reset_Keep, true); break; } } }
public void SetAfterTeleport(int teamId, bool resetTeleport, float teleportDistance, float teleportRotation, ClothParams.TeleportMode teleportMode) { var data = teamWorldInfluenceList[teamId]; data.resetTeleport = resetTeleport ? 1 : 0; data.teleportDistance = teleportDistance; data.teleportRotation = teleportRotation; data.teleportMode = teleportMode; teamWorldInfluenceList[teamId] = data; }
/// <summary> /// ワールド移動影響設定 /// </summary> /// <param name="teamId"></param> /// <param name="worldMoveInfluence"></param> public void SetWorldInfluence(int teamId, float maxSpeed, BezierParam moveInfluence, BezierParam rotInfluence, bool resetTeleport, float teleportDistance, float teleportRotation, float resetStabilizationTime, ClothParams.TeleportMode teleportMode) { var data = teamWorldInfluenceList[teamId]; data.maxMoveSpeed = maxSpeed; data.moveInfluence = new CurveParam(moveInfluence); data.rotInfluence = new CurveParam(rotInfluence); data.resetTeleport = resetTeleport ? 1 : 0; data.teleportDistance = teleportDistance; data.teleportRotation = teleportRotation; data.stabilizationTime = resetStabilizationTime; data.teleportMode = teleportMode; teamWorldInfluenceList[teamId] = data; }
/// <summary> /// クロスの物理シミュレーションをリセットします /// Reset cloth physics simulation. /// </summary> /// <param name="teleportMode">RESET...Resets all simulations. KEEP...Keep the simulation.</param> /// <param name="resetStabilizationTime">Time to stabilize simulation(s).If negative, the time set in the inspector.</param> public void ResetCloth(ClothParams.TeleportMode teleportMode, float resetStabilizationTime = -1.0f) { ResetClothInternal(teleportMode, resetStabilizationTime); }