Fix look-at component for vec3 targets and cameras #261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #229
Vec3 targets were not working. As weddingdj observed, in the update
method the
data
property was the default empty string, and notthe component attribute. Not sure the underlying cause, but probably
in A-Frame's component
buildData
method.This results in the component immediately removing itself.
Resolved here by changing the default to a vec3 rather than empty
string.
Might also resolve #217
Also fixed the -z flip with cameras. The line of code that performs
the flip was commented out, and it is unclear why. I restored that
line and moved the logic to a
lookAt
method on the component, soit could be used in the
update
path as well, which never properlyaccounted for the camera.
In addition, hooked up events to watch for the camera being attached
or detached from the component, which at the very least makes this
component's camera behavior independent of the attribute order.
Finally, I edited the demo scene to add uses of the component that
execute these code paths, to verify it works.