Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid creating objects in reticle and xranchor components #19

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

vincentfretin
Copy link

I optimized the reticle and xranchor components to not create objects on each frame.
I tested the reticle component. I did not test xranchor component, so be sure to test it before merge.

@blairmacintyre
Copy link
Contributor

There used to be a difference between changing these with "setAttribute" (which would update the component values AND set the object3D properties) and just setting the properties directly. Setting the object3D directly wouldn't update the component values.

For example, if a different component wants to look at the rotation or position of an aframe entity, and it get's the property of the corresponding component, in this changed version, it wouldn't see the new values since you are just setting them directly and not calling setAttribute.

Do newer versions of AFrame fix this? (I admit I haven't been paying too close attention to AFrame internals in months).

@vincentfretin
Copy link
Author

This has indeed changed in aframe 0.8.2. setAttribute or getAttribute set or retrieve position, rotation or visible directly on object3D now.

@vincentfretin
Copy link
Author

The behavior you described was indeed an issue on aframe 0.7.1. This is not the case on aframe 0.8.2.

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

Successfully merging this pull request may close these issues.

None yet

2 participants