Skip to content

PhysicsTracker doesn't calculate angular velocity correctly #25

@Yorickvanvliet

Description

@Yorickvanvliet

This code doesn't account for quaternions having 2 representations for the same rotation.
So sometimes it will find a big angle between quaternions when a much smaller angle is the logical choice.

// Update angular data in the same fashion
var rotationOffset = newRotation * Quaternion.Inverse(m_LastRotation);
float currentAngle;
var activeAxis = Vector3.zero;
rotationOffset.ToAngleAxis(out currentAngle, out activeAxis);

I've fixed this in my code by fixing the input into the Update() method. But I guess it should be something PhysicsTracker does internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions