-
Notifications
You must be signed in to change notification settings - Fork 259
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
Added android pinch gesture #120
base: main
Are you sure you want to change the base?
Conversation
added scaling (pinch gesture) to only android smartphones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you reformat code?
try { | ||
when (dict_node["type"] as Int) { | ||
0 -> { // GLTF2 Model from Flutter asset folder | ||
// Get path to given Flutter asset | ||
val loader: FlutterLoader = FlutterInjector.instance().flutterLoader() | ||
val key: String = loader.getLookupKeyForAsset(dict_node["uri"] as String) | ||
|
||
println("FREDTAP2: added model: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed
node.getRenderable()?.setMaterial(x,m); | ||
}*/ | ||
// node.getRenderable()?.getMaterial().setFloat4("baseColorFactor", 1,1,1,1) | ||
println("3a LOADED RENDERABLE " + node.getRenderable()?.getMaterial().toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
anchorNode.addChild(node) | ||
completableFutureSuccess.complete(true) | ||
println("4 LOADED RENDERABLE " + node.getRenderable()?.getSubmeshCount().toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
anchorNode.addChild(node) | ||
completableFutureSuccess.complete(true) | ||
println("4 LOADED RENDERABLE " + node.getRenderable()?.getSubmeshCount().toString()) | ||
println("5 LOADED RENDERABLE " + node.getRenderable()?.getSubmeshCount().toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
} else { | ||
completableFutureSuccess.complete(false) | ||
} | ||
} else { | ||
arSceneView.scene.addChild(node) | ||
val mainHandler = Handler(viewContext.mainLooper) | ||
val runnable = Runnable {sessionManagerChannel.invokeMethod("onError", listOf("2 LOADED RENDERABLE " + node )) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want this hard-coded in here
@@ -776,7 +813,8 @@ internal class AndroidARView( | |||
} catch (e: java.lang.Exception) { | |||
completableFutureSuccess.completeExceptionally(e) | |||
} | |||
|
|||
println("FREDTAP: added model: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
val completableFutureNode: CompletableFuture<CustomTransformableNode> = CompletableFuture() | ||
|
||
val gltfNode = CustomTransformableNode(transformationSystem, objectManagerChannel, enablePans, enableRotation) | ||
println("MAKENODEFROMGLTF: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
lib/managers/ar_object_manager.dart
Outdated
@@ -136,7 +164,9 @@ class ARObjectManager { | |||
} else { | |||
return await _channel.invokeMethod<bool>('addNode', node.toMap()); | |||
} | |||
print("before exception"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
requested a few changes, I also think the iOS version should be added before we can merge this to stay true to the cross-platform approach of this plugin. Any volunteers? |
Why is this only Android based? why is there no iOS counterpart? |
Sry i overlooked this changes. I have chnaged it now. The reason why no IOS support is because i cannot test it because i have no iphone at home :D |
added scaling (pinch gesture) to only android smartphones