X Tutup
Skip to content

ReadRotationPacked can produce nans for W, needs a clamp added #503

@dizzy2003

Description

@dizzy2003

see inserted clamp for w calc

    public Quaternion ReadRotationPacked()
    {
        float x = Mathf.Clamp(ReadSinglePacked(),-1,1);
        float y = Mathf.Clamp(ReadSinglePacked(),-1,1);
        float z = Mathf.Clamp(ReadSinglePacked(),-1,1);
        //                        VVVVVVVV
        float w = Mathf.Sqrt(Mathf.Clamp01(1.0f-Mathf.Pow(x, 2) - Mathf.Pow(y, 2) - Mathf.Pow(z, 2)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup