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

Added android pinch gesture #120

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SebastianAT
Copy link

added scaling (pinch gesture) to only android smartphones

added scaling (pinch gesture) to only android smartphones
Copy link

@sunitasavaliya sunitasavaliya left a 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: ")
Copy link
Owner

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())
Copy link
Owner

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())
Copy link
Owner

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())
Copy link
Owner

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 )) }
Copy link
Owner

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: ")
Copy link
Owner

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: ")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed

@@ -136,7 +164,9 @@ class ARObjectManager {
} else {
return await _channel.invokeMethod<bool>('addNode', node.toMap());
}
print("before exception");
Copy link
Owner

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 Show resolved Hide resolved
@CariusLars
Copy link
Owner

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?

@SscSPs
Copy link

SscSPs commented Jul 12, 2022

Why is this only Android based? why is there no iOS counterpart?
Asking just to have better documentation of the decision here.

@SebastianAT
Copy link
Author

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

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.

4 participants