Search Unity

Question Get reaction force value from contact data

Discussion in 'Physics for ECS' started by Sab_Rango, Jul 7, 2021.

  1. Sab_Rango

    Sab_Rango

    Joined:
    Aug 30, 2019
    Posts:
    121
    Hello!
    I am trying to build an animation tool that consistently relies on physics rules and collation response .

    It's going have these main structures
    1. movement will be generated by muscle force (here the formula that I build myself link https://www.artstation.com/artwork/bKqE9o)

    2. automatic or manual grab, walk , climb like functions by learning motion energy state by those "contact force sensor" system ---similar to biological body sensor.



    I know that I need to be well familiar with Jacobian solver to get those force value that sensor receives during contact frame.


    But so far I learned simple physics engine building system (book by Ian Millington )


    Little direction help is much appreciated, maybe some links to learn Jacobian solver
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    Ultimately the iterative solver calls the Build function of the relevant Jacobian (see com.unity.physics\Unity.Physics\Dynamics\Jacobians) to get the initial error values (e.g. displacement vector for a linear constraint) and then the Solve function of the same Jacobian for each iteration. The Solve function is actually apply the appropriate fixup impulse. The ContactJacobian goes a little further, checking if it is the last iteration and fires a CollisionEvent is requested.

    If you call CalculateDetails, the CollisionEvents can give you the EstimatedImpulse applied by the ContactJacobian.Solve. Its estimated as the colliding bodies might not be actually touching at the specific elapsed time of the app.

    It sounds like you will really need the Impulses from the Linear and Angular Limit Constraints more than the Collision Events. At the minute the Constraints don't have motors. I know of a few developers who have added their own motor systems and they will obviously have access to the necessary impulses involved in the 'muscle'. Moreover the Jacobians associated with the Contraints don't fire events (useful for deformation or breaking logic etc).

    The Physics team are looking at adding Joint events and motor support into the DOTS Physics packages in general though I have no timelines to share at the minute.
     
    Sab_Rango likes this.