Fix look-at component for vec3 targets and cameras#261
Merged
ngokevin merged 1 commit intosupermedium:masterfrom May 8, 2020
Merged
Fix look-at component for vec3 targets and cameras#261ngokevin merged 1 commit intosupermedium:masterfrom
ngokevin merged 1 commit intosupermedium:masterfrom
Conversation
fix supermedium#229 Vec3 targets were not working. As weddingdj observed, in the update method the `data` property was the default empty string, and not the 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 supermedium#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, so it could be used in the `update` path as well, which never properly accounted 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.
Contributor
|
FYI, there is another issue with immersive mode I fixed in PR #257 |
Contributor
Author
|
Ah yeah I noticed that after I had opened this. Unfortunately it looks like the supermedium team might not have the time to review these PRs considering there are 10 open with the oldest from a year ago. |
Contributor
Author
|
guess not! Thanks @ngokevin. Didn't mean that to come off as a passive aggressive complaint :| Appreciate everything you're doing! |
Collaborator
|
none taken, thanks for reminding me and the help |
|
hi, I try this and it's not working for camera component? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
dataproperty was the default empty string, and notthe component attribute. Not sure the underlying cause, but probably
in A-Frame's component
buildDatamethod.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
lookAtmethod on the component, soit could be used in the
updatepath 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.