Example #1
0
    public void Update()
    {
      if ( SimulationManager.ReadSimulationBufferUniqueUnsafe( BroadcastStart, UpdateBody ) )
      {
        statistics_           = SimulationManager.simStatistics_;
        listJointGroupsInfo_  = SimulationManager.listJgInfo_;
        listExplosionInfo_    = SimulationManager.listExplosionInfo_;
        listContactEventInfo_ = SimulationManager.listContactEventInfo_;
   
        UpdateListsBodyGORequested      = true;
        UpdateListJointsRequested       = true;
        UpdateClothCollidersRequested   = true;

        SceneView.RepaintAll();
      }

      if ( UpdateListsBodyGORequested )
      {
        CreateBodyBoxes();
      }

      if ( UpdateListJointsRequested )
      {
        CreateJointPivotBoxes();
      }

      if ( UpdateClothCollidersRequested )
      {
        CreateClothSpheres();
      }
    }
    //-----------------------------------------------------------------------------------
    public void Update()
    {
      if ( SimulationManager.ReadSimulationBufferUniqueUnsafe( BroadcastStart, UpdateBody, UpdateCorpuscles ) )
      {
        statistics_           = SimulationManager.simStatistics_;
        listJointGroupsInfo_  = SimulationManager.listJgInfo_;
        listExplosionInfo_    = SimulationManager.listExplosionInfo_;
        listContactEventInfo_ = SimulationManager.listContactEventInfo_;
   
        UpdateListsBodyGORequested      = true;
        UpdateListJointsRequested       = true;
        UpdateClothCollidersRequested   = true;

        InternalEditorUtility.RepaintAllViews();
      }

      if ( UpdateListsBodyGORequested )
      {
        CreateBodyBoxes();
      }

      if ( UpdateListJointsRequested )
      {
        CreateJointPivotBoxes();
      }

      if ( UpdateClothCollidersRequested )
      {
        CreateClothSpheres();
      }

      if (nCorpuscles_ > 0)
      {
        RebindCorpuscleRenderersShaderAttributes();
      }
    }