Enable updatePosition, updateRotation and updateScale of existing Nodes#125
Enable updatePosition, updateRotation and updateScale of existing Nodes#125wiizarrrd wants to merge 7 commits intogiandifra:masterfrom
Conversation
enable update Position
no toast
|
How to use in flutter: Simple usage: main parts of the implementation:
ArCoreView in the build method _onArCoreViewCreated _onPlaneTap |
|
@wiizarrrd can u share full code about rotating 3d model after placing please? |
|
I can share some important parts. The aim of the code is to rotate an object so that it sticks to a wall like a picture with a frame. Quarternions file: import 'dart:math'; import 'package:vector_math/vector_math_64.dart'; class QuaternionCalculations { //x and y HAVE TO be switched for some reason //Source: https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles } static double copySign(double value, double sign) { // static List _toEulerAnglesDeg(Quaternion q) { main file import 'dart:async'; import 'package:arcore_flutter_plugin/arcore_flutter_plugin.dart'; import '../contants.dart'; class ARCoreScreen extends StatefulWidget { ARCoreScreen(this.debug); @OverRide class _ARCoreScreenState extends State { ArCoreController arCoreController; Timer timer; double infoNodeFactor = 1.1; //4 different options to dis-/enable // _ARCoreScreenState(){ @OverRide } @OverRide Widget get _buildOptionalTouchScreenTap { Widget get _buildOptionalSliders { _onInfoNodeFactorChange(double newFactor) { _onScaleChange(double newFactor) async { @OverRide void _onArCoreViewCreated(ArCoreController controller) { Future _onPlaneTap(List hits) async { Future _onNodeTap(String nodeName) async { Future _addObject(ArCoreHitTestResult hit) async { Future addNodes(vector.Vector4 r, vector.Vector3 t) async { } void rotateObject(vector.Vector4 r, vector.Vector3 t) { } Future simulateTouchScreenTapProcess() async { Future<Map<String, double>> _processImage(String path) async { } Future simulateTouchScreenTap(double xPos, double yPos) async { } |
|
@wiizarrrd does your package follows null-safety ? |
For the Kotlin part it was trial & error so I can't tell. Probably not. |
|
@wiizarrrd i tried to add your package . But i'm getting compiler error tried C:\Users\bhara\AppData\Local\Pub\Cache\git\arcore_flutter_plugin-28f6ad239e3c45bcd5c124c564f050fc81925a62\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (281, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(p0: Activity, p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks
e: C:\Users\bhara\AppData\Local\Pub\Cache\git\arcore_flutter_plugin-28f6ad239e3c45bcd5c124c564f050fc81925a62\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (282, 13): 'onActivityCreated' overrides nothing |
|
@wiizarrrd any updates on this? |
Enable updatePosition