Skip to content

Allow to specify coordinate origin#122

Merged
macrozone merged 4 commits intomasterfrom
origin-property
Dec 21, 2017
Merged

Allow to specify coordinate origin#122
macrozone merged 4 commits intomasterfrom
origin-property

Conversation

@macrozone
Copy link
Copy Markdown
Collaborator

@macrozone macrozone commented Dec 7, 2017

you can now specify an origin property on the <ARKit /> component with a position.

The whole scene is then shifted, so that {x:0, y:0, z:0} is at that origin.position (which is specified in "absolute" coordinates to the normal origin)

  <ARKit
    origin={{
      position: {
        x: 0,
        y: floorPlane ? floorPlane.position.y : 0,
        z: 0,
      },
      transition: {
        duration: 0.1,
      },
    }}

you can specify a transition as well, so that the changes in the origin.position is animated.

Every intersection-function (hittest, projectPosition, etc.) should respect that new origin and will give coordinates relative to that origin. The original position is also passed as "absolutePosition"

TODO:

  • update readme
  • check if all functions respect that new origin

published as 0.6.2-beta to try

@macrozone
Copy link
Copy Markdown
Collaborator Author

readme update will come in another pr

@macrozone macrozone merged commit 6b7d053 into master Dec 21, 2017
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.

1 participant