Skip to content

Conversation

@ngokevin
Copy link
Member

@ngokevin ngokevin commented Aug 10, 2016

Description:

Caused by #1724

Since we waited for scene to load before setting up the camera. We have to tell the scene to wait for the camera as well.

  • unit tests

Changes proposed:

  • Wait on camera-set-active before render if camera does not yet exist.

this.addEventListener('loaded', function () {
if (this.renderStarted) { return; }
AEntity.prototype.play.call(this); // .play() *before* render.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want to start playing before rendering? What if there's components that rely on having an active camera?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All entities initialize before the scene gets here. With our without this patch, I believe they would have had to listen to the camera-set-active event, so nothing is changed here.

I had it within the startRender before but it broke some tests. I can try to play with it more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yeah, perhaps it's best to start execution and rendering at the same time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get it working by calling play only after camera, but couldn't get the tests passing. I might have some code quality improvements though.

@dmarcos dmarcos merged commit 04b2d86 into aframevr:master Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants