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

Fix look-at component for vec3 targets and cameras #261

Merged
merged 1 commit into from
May 8, 2020

Conversation

gregfagan
Copy link
Contributor

fix #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 #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.

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.
@vincentfretin
Copy link
Contributor

FYI, there is another issue with immersive mode I fixed in PR #257

@gregfagan
Copy link
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.

@ngokevin ngokevin merged commit ca892ac into supermedium:master May 8, 2020
@gregfagan
Copy link
Contributor Author

guess not! Thanks @ngokevin. Didn't mean that to come off as a passive aggressive complaint :|

Appreciate everything you're doing!

@ngokevin
Copy link
Collaborator

ngokevin commented May 9, 2020

none taken, thanks for reminding me and the help

@flankechen
Copy link

hi, I try this and it's not working for camera component?

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