Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

fix: make camera report position from start #1928

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

nchamo
Copy link
Contributor

@nchamo nchamo commented Jan 12, 2021

Fixes #1911

@nchamo nchamo requested a review from a team January 12, 2021 18:27
@nchamo nchamo self-assigned this Jan 12, 2021
@github-actions
Copy link

@nchamo nchamo merged commit 7b0c084 into master Jan 12, 2021
@nchamo nchamo deleted the fix/make-camera-report-position-from-start branch January 12, 2021 18:30
@menduz
Copy link
Member

menduz commented Jan 13, 2021

This PR generates another problem. 100% of the ECS scenes will subscribe to the events of the camera. That is, at least one message per frame, per let's say 25 scenes loaded in memory. 60*25=1500 messages generated and serialized and sent to the scenes even though they don't need it

A cleaner solution would be to expose a function like this

export async function getCameraInstance() {
  const instance = Camera.instance
  await nextFrame()
  return instance
}

I'd revert this PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camera.instance.position returns 0,0,0 the first time it's called
3 participants