INNER CODE UNIT · C#

AfterSimulationUpdate

stride3d/stride-community-toolkit · src/Stride.CommunityToolkit.Bepu/Body2DComponent.cs:191

    public virtual void AfterSimulationUpdate(BepuSimulation sim, float simTimeStep) { }

    /// <summary>
    /// Removes the body's ability to rotate about X and Y for all practical purposes, leaving Z free.
    /// </summary>
    private void ApplyRotationLock()
    {
        var inertia = BodyInertia;
        ref var inverseInertia = ref inertia.InverseInertiaTensor;

        // Scaled rather than zeroed - see OutOfPlaneInertiaScale, this is not an oversight
        inverseInertia.XX *= OutOfPlaneInertiaScale;
        inverseInertia.YY *= OutOfPlaneInertiaScale;
        inverseInertia.YX = 0f;
        inverseInertia.ZX = 0f;
        inverseInertia.ZY = 0f; // ZZ is left alone, so the body can still roll in the plane

        BodyInertia = inertia;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…