Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

PhysicsGraphicalSmoothing in pure ECS

Discussion in 'Physics for ECS' started by argibaltzi, Oct 11, 2020.

  1. argibaltzi

    argibaltzi

    Joined:
    Nov 13, 2014
    Posts:
    193
    Hi
    Does anyone know the proper way to add this data on an entity to get "automatic" smoothing?

    I am using the conversion classes for gameobjects but i do create the physics manually

    Is it a simple case of calling this code once?

    Code (CSharp):
    1.  
    2. EntityManagerRef.AddComponentData<PhysicsGraphicalSmoothing>(newEntity, new PhysicsGraphicalSmoothing() { ApplySmoothing = 1 });
    3.  
    4. EntityManagerRef.AddComponentData<PhysicsGraphicalInterpolationBuffer>(newEntity, new PhysicsGraphicalInterpolationBuffer() {  });
    5.  
    6.  
     
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Yes, that should do it. Just keep in mind that there are PreviousVelocity and PreviousTransform fields in the interpolation buffer component data.
     
    argibaltzi likes this.