Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Custom ObiUpdater
#1
Pregunta 
Hi,

I'm trying to create a custom class that inherits from ObiUpdater that can simulate in one frame.

So far I have this class which I based on the code for ObiFixedUpdater:

Code:
public class PatchUpdater : ObiUpdater
{
    public void UpdateCloth(float delta, int substeps)
    {
        ObiProfiler.EnableProfiler();
       
        float substepDelta = delta / substeps;

        BeginStep(delta);

        for (int i = 0; i < substeps; ++i)
        {
            Substep(substepDelta);
        }
       
        EndStep(substepDelta);
       
        ObiProfiler.DisableProfiler();
    }
}

I've added the solver to the list of solvers in the inspector, and the simulation works using the ObiFixedUpdater component.

I would expect that given the parameters (3, 10) after calling the function the cloth's appearance would reflect 3 seconds worth of simulating. However, this doesn't appear to simulate the cloth at all.

What am I missing? Please let me know if I should provide any further information.

Cheers,
Jordan
Reply


Messages In This Thread
Custom ObiUpdater - by JordanTama - 18-10-2020, 01:10 AM
RE: Custom ObiUpdater - by josemendez - 19-10-2020, 07:24 AM