Commit e6d3d2e3 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

+background later init

parent 90acde40
...@@ -61,8 +61,7 @@ var SETTINGS = { ...@@ -61,8 +61,7 @@ var SETTINGS = {
'edit': false, 'edit': false,
'files': { 'files': {
'x3d':"", 'x3d':"",
'x3d_background':"", 'kml':""
'kml':"",
} }
// 'kml' : "scene.kml" // 'kml' : "scene.kml"
} }
...@@ -109,7 +108,6 @@ $(function(){ ...@@ -109,7 +108,6 @@ $(function(){
parseURL(); parseURL();
SETTINGS.files.x3d = SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.version+"/"+SETTINGS.path+".x3d"; SETTINGS.files.x3d = SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.version+"/"+SETTINGS.path+".x3d";
SETTINGS.files.x3d_background = SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.version+"/"+SETTINGS.path+"-texture-bgnd-ext.jpeg";
// always reload kml // always reload kml
SETTINGS.files.kml = SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.path+".kml"; SETTINGS.files.kml = SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.path+".kml";
...@@ -144,17 +142,31 @@ function title_init(){ ...@@ -144,17 +142,31 @@ function title_init(){
} }
function light_init(){ function background_check(){
var mback = $("#x3d_id").find("scene").find("Background");
return (mback.length>0);
}
function background_init(){
var x3delement = $("#x3d_id").find("scene"); var x3delement = $("#x3d_id").find("scene");
//var model_back_url = SETTINGS.files.x3d_background;
var model_back_url = "";
var model_url = SETTINGS.files.x3d; var mback = $("#x3d_id").find("scene").find("Background");
var model_back_url = SETTINGS.files.x3d_background;
if (mback.length>0){
frontUrl = mback.attr('frontUrl');
if (frontUrl.length!=0){
model_back_url = SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.version+"/"+frontUrl;
}
}
if (model_back_url!=""){
mback.remove();
var model = $([ var model = $([
'<group>',
' <inline name="mymodel" namespacename="mymodel" url="'+model_url+'"></inline>',
'</group>',
'<group>', '<group>',
' <Background ', ' <Background ',
' id="Background"', ' id="Background"',
...@@ -170,6 +182,29 @@ function light_init(){ ...@@ -170,6 +182,29 @@ function light_init(){
].join('\n')); ].join('\n'));
x3delement.append(model); x3delement.append(model);
//set sensitivity
}else{
$("#shiftspeed").val(0.0005);
$("#shiftspeed").change();
}
}
function light_init(){
var x3delement = $("#x3d_id").find("scene");
var model_url = SETTINGS.files.x3d;
var model_back_url = SETTINGS.files.x3d_background;
var model = $([
'<group>',
' <inline name="mymodel" namespacename="mymodel" url="'+model_url+'"></inline>',
'</group>'
].join('\n'));
x3delement.append(model);
$.ajax({ $.ajax({
url: SETTINGS.files.kml+"?"+Date.now(), url: SETTINGS.files.kml+"?"+Date.now(),
...@@ -225,6 +260,7 @@ function light_init(){ ...@@ -225,6 +260,7 @@ function light_init(){
map_resize_init(); map_resize_init();
deep_init(); deep_init();
//align_init(); //align_init();
x3d_initial_camera_placement(); x3d_initial_camera_placement();
Scene.resize(); Scene.resize();
...@@ -357,6 +393,17 @@ function deep_init(){ ...@@ -357,6 +393,17 @@ function deep_init(){
progress_counter = progress_counter.split(" "); progress_counter = progress_counter.split(" ");
cnt = parseInt(progress_counter[1]); cnt = parseInt(progress_counter[1]);
if (!Scene._X3DOM_SCENE_INIT_BACK_DONE){
//console.log(cnt+" "+background_check());
var bc = background_check();
if (bc){
background_init();
Scene._X3DOM_SCENE_INIT_BACK_DONE = true;
}
}
if (!Scene._X3DOM_SCENE_INIT_DONE&&(cnt==0)){ if (!Scene._X3DOM_SCENE_INIT_DONE&&(cnt==0)){
//Scene.initResize(); //Scene.initResize();
...@@ -365,7 +412,7 @@ function deep_init(){ ...@@ -365,7 +412,7 @@ function deep_init(){
Scene.ShapeEvents(); Scene.ShapeEvents();
Scene._X3DOM_SCENE_INIT_DONE = true; Scene._X3DOM_SCENE_INIT_DONE = true;
Scene._X3DOM_SCENE_INIT_BACK_DONE = true;
} }
}; };
......
...@@ -62,6 +62,7 @@ var X3DOMObject = function(element,data,options){ ...@@ -62,6 +62,7 @@ var X3DOMObject = function(element,data,options){
this.old_view_translation = null; this.old_view_translation = null;
// status vars // status vars
this._X3DOM_SCENE_INIT_BACK_DONE = false;
this._X3DOM_SCENE_INIT_DONE = false; this._X3DOM_SCENE_INIT_DONE = false;
this._ctrlKey = false; this._ctrlKey = false;
this._shiftKey = false; this._shiftKey = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment