Skip to content
Snippets Groups Projects
Commit f34731a3 authored by Xavier Gibert's avatar Xavier Gibert
Browse files

Spacecraft axis

parent 9386c0f9
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ function showAndroidToast(toast) {
//Option blocked for robustness (S/C will show the attitude and a view will follow it)
//show_spacecraft = config.show_spacecraft;//If set to false, instead of a S/C it will be a miniSphere in the reference position.
show_sc_axis = config.show_sc_axis;
sc_show_eng_texture = config.sc_show_eng_texture;
show_sun = config.show_sun;
......@@ -87,6 +88,7 @@ function showAndroidToast(toast) {
show_planes = false;
//show_spacecraft = true;//If set to false, instead of a S/C it will be a miniSphere in the reference position.
show_sc_axis = true;
sc_show_eng_texture = false;
show_sun = false;
......
......@@ -88,6 +88,7 @@ This three.js demo is part of a collection at
var torus_radius = sphere_radius;
var torus_tube = 0.5;
var sc_axis_lenght = sphere_radius*0.4;
var sc_body_color = 0xDDDDDD;
var sc_window_color = 0x00d4ff;
var sc_engine_color = 0x545454;
......@@ -127,6 +128,7 @@ This three.js demo is part of a collection at
var show_planes = true;
var show_spacecraft = true;//If set to false, instead of a S/C it will be a miniSphere in the reference position.
var show_sc_axis = true;
var sc_show_eng_texture = true;
var show_sun = true;
......
......@@ -126,7 +126,11 @@ function init()
//-----------------------------------------------------------------------------------------------------------------------
if(show_spacecraft){
spacecraft = new THREE.Object3D();
//spacecraft.useQuaternion = true;
if(show_sc_axis){
var sc_axis = new THREE.AxisHelper( sc_axis_lenght );
sc_axis.position.set( 0, 0, 0 );
spacecraft.add( sc_axis );
}
if(!canvas_mode)
var sc_material = new THREE.MeshLambertMaterial( { color: sc_body_color, metal: true, shading: THREE.SmoothShading, blending: THREE.AdditiveBlending, vertexColors: THREE.VertexColors } );
else
......
......@@ -38,6 +38,7 @@
<string name="pref_key_show_axis">pref_key_show_axis</string>
<string name="pref_key_show_axis_labels">pref_key_show_axis_labels</string>
<string name="pref_key_show_spacecraft">pref_key_show_spacecraft</string>
<string name="pref_key_show_sc_axis">pref_key_show_sc_axis</string>
<string name="pref_key_show_engine_texture">pref_key_show_engine_texture</string>
<string name="pref_key_show_sun">pref_key_show_sun</string>
<string name="pref_key_show_earth">pref_key_show_earth</string>
......
......@@ -154,6 +154,8 @@
<string name="pref_summary_show_axis_labels">Show reference axis labels</string>
<string name="pref_title_show_spacecraft">Show spacecraft</string>
<string name="pref_summary_show_spacecraft">Show spacecraft model</string>
<string name="pref_title_show_sc_axis">Show spacecraft axis</string>
<string name="pref_summary_show_sc_axis">Show spacecraft reference axis</string>
<string name="pref_title_show_engine_texture">Show engine texture</string>
<string name="pref_summary_show_engine_texture">Show spacecraft engine texture</string>
<string name="pref_title_sun_simple_glow">Simple glow effect</string>
......
......@@ -9,6 +9,11 @@
android:summary="@string/pref_summary_show_spacecraft"
android:title="@string/pref_title_show_spacecraft"
android:defaultValue="true" /> -->
<CheckBoxPreference
android:key="@string/pref_key_show_sc_axis"
android:summary="@string/pref_summary_show_sc_axis"
android:title="@string/pref_title_show_sc_axis"
android:defaultValue="true" />
<CheckBoxPreference
android:key="@string/pref_key_show_engine_texture"
android:summary="@string/pref_summary_show_engine_texture"
......
......@@ -31,6 +31,7 @@ public class ModelConfiguration {
show_axis = sharedPref.getBoolean(ctx.getString(R.string.pref_key_show_axis), show_axis);
show_axis_labels = sharedPref.getBoolean(ctx.getString(R.string.pref_key_show_axis_labels), show_axis_labels);
show_spacecraft = sharedPref.getBoolean(ctx.getString(R.string.pref_key_show_spacecraft), show_spacecraft);
show_sc_axis = sharedPref.getBoolean(ctx.getString(R.string.pref_key_show_sc_axis), show_sc_axis);
sc_show_eng_texture = sharedPref.getBoolean(ctx.getString(R.string.pref_key_show_engine_texture), sc_show_eng_texture);
sun_rotates = sharedPref.getBoolean(ctx.getString(R.string.pref_key_sun_rotates), sun_rotates);
show_sun = sharedPref.getBoolean(ctx.getString(R.string.pref_key_show_sun), show_sun);
......@@ -74,6 +75,7 @@ public class ModelConfiguration {
public boolean show_axis_labels = true;
//Spacecraft
public boolean show_spacecraft = true;
public boolean show_sc_axis = true;
public boolean sc_show_eng_texture = true;
//Sun
public boolean show_sun = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment