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

Click Source Position is not Correct in AR #484

Closed
EdwardLu2018 opened this issue Aug 4, 2022 · 3 comments · Fixed by #473
Closed

Click Source Position is not Correct in AR #484

EdwardLu2018 opened this issue Aug 4, 2022 · 3 comments · Fixed by #473
Labels
bug Something isn't working

Comments

@EdwardLu2018
Copy link
Member

Describe the bug
Click source position is not correct in AR.

To Reproduce
Steps to reproduce the behavior:

  1. Go to some scene with a clickable object
  2. Run python laser pointer program
  3. Click on object
  4. Laser's source position will not be updated to re-localized origin
@EdwardLu2018 EdwardLu2018 added the bug Something isn't working label Aug 4, 2022
@hi-liang
Copy link
Member

hi-liang commented Aug 4, 2022

const camera = document.getElementById('my-camera');
const position = camera.getAttribute('position');
const clickPos = ARENAUtils.vec3ToObject(position);
const coordsData = ARENAUtils.setClickData(evt);
if ('cursorEl' in evt.detail) {
// original click event; simply publish to MQTT
const thisMsg = {
object_id: this.id,
action: 'clientEvent',
type: 'mousedown',
data: {
clickPos: clickPos,
position: coordsData,

Need to go through all these clientEvents and change the position from camera position to world position (factors in rig position/rotation offsets)

@mwfarb
Copy link
Contributor

mwfarb commented Aug 4, 2022

We still need both camera position and object intersection position right? Just that both will be in world coordinates after the change?

@hi-liang
Copy link
Member

hi-liang commented Aug 4, 2022

The intersection position comes from AFRAME I think, which should already be in world coordinates. The commit above just fixes the camera positions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants