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
Add support to calculate distance between device and anchor and distance between two anchors #115
Conversation
Tested out getDistanceFromAnchor and getDistanceBetweenAnchors on iOS and all seems to be working well without any issues. Currently in the process of testing on Android |
Hey @dnkoulouris , thanks for the contribution! I left a few comments on your code but looks good otherwise, once @Petroni is done testing on Android and the comments are fixed I'm happy to merge :) |
2 Small issues on the Android side. AndroidARView.kt f line 108 & 116 are throwing errors due to being passing null values. |
So, what is the current status? |
I also fixed the error that @Petroni mentioned in my fork |
Hey folks, sorry for the late reply, I've been very busy the last couple of weeks.. @dnkoulouris thanks for the fix, could you reply to / fix the three review comments I left after your initial PR above? After that I´m happy to merge :) |
@CariusLars I can not see your commits. In which branch/repo are they? |
Readme file reverted to the original state. |
I also made a commit that fixes this issue. |
awesome, thanks @dnkoulouris! I merged this just now :) |
This pull request implements two functionalities that are required for many use cases:
The distance is counted in meters and uses the Vector 3 square root method.
Method
getCameraPose()
that obtains device coordinates is required and was cloned from gps branchMethods added in
ar_session_manager.dart
along with the required platform code in Swift and Kotlin:getPose(ARAnchor anchor)
: Returns the given anchor pose in Matrix4 format with respect to the world coordinate system of the ARView.getDistanceBetweenAnchors(ARAnchor anchor1, ARAnchor anchor2)
: Returns the distance in meters between @anchor1 and @Anchor2.getDistanceFromAnchor(ARAnchor anchor)
: Returns the distance in meters between @anchor and device's camera.getDistanceBetweenVectors(Vector3 vector1, Vector3 vector2)
: Returns the distance in meters between @vector1 and @vector2.