Skip to content

camera.screenToWorld calculates incorrectly for orthographic camera until first update is done #5825

Description

@OlegGedzjuns

Description

Example: https://playcanvas.com/project/1163442/overview/incorrect-screentoworld
(projection and orthographic cameras. Both calculate the left center screen border screenToWorld position 4 times. During initialize, postInitialize, first and second update)

  1. launch scene
  2. open dev tools
  3. reload page
  4. check logs

camera with perspective projection calculates world position correctly all 4 times

camera with orthographic projection calculates incorrectly during initialize and postInitialize
on the first update only y is calculated correctly
on the second and all subsequent updates x and y are calculated correctly

image

Platform: Windows
Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions