Beispiel #1
0
        public void SimulateStep(float stepTime)
        {
            foreach (ObiActor actor in actors)
            {
                actor.OnSolverStepBegin();
            }

            // Trigger event right after actors have fixed their particles in OnSolverStepBegin.
            if (OnFixedParticlesUpdated != null)
            {
                OnFixedParticlesUpdated(this, null);
            }

            // Update all collider and rigidbody information, so that the solver works with up-to-date stuff.
            // This is only actually done for the first solver that calls it this step.
            if (colliderGroup != null)
            {
                colliderGroup.UpdateBodiesInfo(this);
            }

            ObiArbiter.FrameStart();

            // Update the solver (this is internally split in tasks so multiple solvers can be updated in parallel)
            Oni.UpdateSolver(oniSolver, stepTime);

            // Wait here for all other solvers to finish, if we are the last solver to call this.
            ObiArbiter.WaitForAllSolvers();
        }
Beispiel #2
0
        public void SimulateStep(float stepTime)
        {
            foreach (ObiActor actor in actors)
            {
                actor.OnSolverStepBegin();
            }

            // Update all collider and rigidbody information, so that the solver works with up-to-date stuff:
            if (colliderGroup != null)
            {
                colliderGroup.UpdateBodiesInfo();
            }

            // Update the solver:
            Oni.UpdateSolver(oniSolver, stepTime);

            // Apply modified rigidbody velocities and torques properties back:
            if (colliderGroup != null)
            {
                colliderGroup.UpdateVelocities();
            }

            TriggerCollisionEvents();

            foreach (ObiActor actor in actors)
            {
                actor.OnSolverStepEnd();
            }
        }
Beispiel #3
0
        public void SimulateStep(float stepTime)
        {
            foreach (ObiActor actor in actors)
            {
                actor.OnSolverStepBegin();
            }

            // Trigger event right after actors have fixed their particles in OnSolverStepBegin.
            if (OnFixedParticlesUpdated != null)
            {
                OnFixedParticlesUpdated(this, null);
            }

            // Update all collider and rigidbody information, so that the solver works with up-to-date stuff:
            if (colliderGroup != null)
            {
                colliderGroup.UpdateBodiesInfo();
            }

            // Update the solver:
            Oni.UpdateSolver(oniSolver, stepTime);

            // Apply modified rigidbody velocities and torques back:
            if (colliderGroup != null)
            {
                colliderGroup.UpdateVelocities();
            }

            // Trigger solver events:
            TriggerCollisionEvents();

            foreach (ObiActor actor in actors)
            {
                actor.OnSolverStepEnd();
            }
        }