提交 f9e6587c 作者: cbd

1、参数优化

上级 42c71aae
...@@ -90,7 +90,6 @@ public class ModelActivity extends AppCompatActivity implements EventListener { ...@@ -90,7 +90,6 @@ public class ModelActivity extends AppCompatActivity implements EventListener {
String mtlName = ""; String mtlName = "";
//是否能够触摸与缩放 //是否能够触摸与缩放
private boolean canTouch =false; private boolean canTouch =false;
private URI puri;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -286,6 +285,8 @@ public class ModelActivity extends AppCompatActivity implements EventListener { ...@@ -286,6 +285,8 @@ public class ModelActivity extends AppCompatActivity implements EventListener {
objName = url.substring(url.lastIndexOf('/') + 1); objName = url.substring(url.lastIndexOf('/') + 1);
}else if(url.contains("mtl")){ }else if(url.contains("mtl")){
mtlName = url.substring(url.lastIndexOf('/') + 1); mtlName = url.substring(url.lastIndexOf('/') + 1);
}else if(url.contains("dae")){
objName = url.substring(url.lastIndexOf('/') + 1);
} }
if (destFile.exists()) { if (destFile.exists()) {
downloadCount +=1; downloadCount +=1;
...@@ -309,17 +310,17 @@ public class ModelActivity extends AppCompatActivity implements EventListener { ...@@ -309,17 +310,17 @@ public class ModelActivity extends AppCompatActivity implements EventListener {
private void initScene(Uri uri) { private void initScene(Uri uri) {
Log.i("ModelActivity", "Loading Scene..."); Log.i("ModelActivity", "Loading Scene...");
try { try {
puri = URI.create(uri.toString()); this.paramUri = URI.create(uri.toString());
} catch (Exception e) { } catch (Exception e) {
// info: filesystem url may contain spaces, therefore we re-encode URI // info: filesystem url may contain spaces, therefore we re-encode URI
try { try {
puri = new URI(uri.getScheme(), uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment()); this.paramUri = new URI(uri.getScheme(), uri.getAuthority(), uri.getPath(), uri.getQuery(), uri.getFragment());
} catch (URISyntaxException ex) { } catch (URISyntaxException ex) {
Toast.makeText(this, "Error: " + uri.toString(), Toast.LENGTH_LONG).show(); Toast.makeText(this, "Error: " + uri.toString(), Toast.LENGTH_LONG).show();
return; return;
} }
} }
scene = new SceneLoader(this, puri, paramType); scene = new SceneLoader(this, this.paramUri, paramType);
scene.addListener(this); scene.addListener(this);
if (paramUri == null) { if (paramUri == null) {
// final LoaderTask task = new DemoLoaderTask(this, null, scene); // final LoaderTask task = new DemoLoaderTask(this, null, scene);
...@@ -425,6 +426,8 @@ public class ModelActivity extends AppCompatActivity implements EventListener { ...@@ -425,6 +426,8 @@ public class ModelActivity extends AppCompatActivity implements EventListener {
objName = url.substring(url.lastIndexOf('/') + 1); objName = url.substring(url.lastIndexOf('/') + 1);
}else if(url.contains(".mtl")){ }else if(url.contains(".mtl")){
mtlName = url.substring(url.lastIndexOf('/') + 1); mtlName = url.substring(url.lastIndexOf('/') + 1);
}else if(url.contains(".dae")){
objName = url.substring(url.lastIndexOf('/') + 1);
} }
Log.e("file= ", "objName= "+objName+" mtlName= " + mtlName +" counter= "+counter); Log.e("file= ", "objName= "+objName+" mtlName= " + mtlName +" counter= "+counter);
if (counter == datas.size()) { // 所有请求都完成了 if (counter == datas.size()) { // 所有请求都完成了
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论