Skip to content

NaN when looking_at is called with Transform's origin as target #3736

@ghost

Description

Bevy version

0.5 and 0.6

Operating system & version

Linux Mint 20.2

What you did

I modified the 3D Scene example so line 42 read as,
transform: Transform::from_xyz(0.0, 0.0, 0.0).looking_at(Vec3::ZERO, Vec3::Y),

As you can see, the origin of the transform is the same as where it's set to look.

What you expected to happen

Default to either current Quat or the unit matrix.

What actually happened

Printing the debug value of that particular transform produced,
Mut(Transform { translation: Vec3(NaN, NaN, NaN), rotation: Quat(NaN, NaN, NaN, NaN), scale: Vec3(1.0, 1.0, 1.0) })

and attempting to further modify it resulted in no change (as expected, given what's happening).

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MathFundamental domain-agnostic mathematical operationsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions