Skip to content

Conversation

@dmarcos
Copy link
Member

@dmarcos dmarcos commented Jun 18, 2016

Description:

There's a bogus situation if play is called on a component that has not been yet initialized and the logic relies on something done in the init method.

The bug has manifested when the camera system pauses the inactive camera entity and plays the new active one. With the default camera the camera system calls play on the entity. The camera component is initialized before look-controls and its play method invoked before init. The play method of look-controls expects the methods to be bound before attaching the event listeners.

Changes proposed:
Ensure that play is never invoked before init and also prevent play/pause logic to be executed multiple times if the component is already playing or paused respectively.

NewComponent.prototype.name = name;
NewComponent.prototype.constructor = NewComponent;
NewComponent.prototype.system = systems && systems.systems[name];
// Wraps method to meet needed gurantees
Copy link
Member

Choose a reason for hiding this comment

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

Wraps methods to meet needed guarantees.

Can also explain what the "guarantees" are.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants