enableLighting on Central Body

I run following code in the Sandbox:
require([‘Cesium’], function(Cesium)
{

“use
strict”;

var gallery =

‘…/…/CesiumViewer/Gallery/’;

function

createButtons() {

var toolbar = document.getElementById(‘toolbar’);

    var button = document.createElement('button');

button.className = ‘cesium-button’;

button.onclick = function() {

viewer.centralBody.enableLighting = true;

//centralBody.enableLighting = true;

};

button.textContent = ‘Show Lighting’;

toolbar.appendChild(button);

button = document.createElement(‘button’);

button.className = ‘cesium-button’;

button.onclick = function() {

viewer.centralBody.enableLighting = false;

//centralBody.enableLighting = false;

};

button.textContent = ‘Hide Lighting’;

toolbar.appendChild(button);

button = document.createElement(‘button’);

button.className = ‘cesium-button’;

button.onclick = function() {

viewer.centralBody.enableLighting = null;

};

button.textContent = ‘Hide Lighting (null)’;

toolbar.appendChild(button);

}

var viewer =
new Cesium.Viewer(‘cesiumContainer’);

viewer.extend(Cesium.viewerDynamicObjectMixin);

createButtons();

var scene =
viewer.scene;

var centralBody
= scene.getPrimitives().getCentralBody();

Sandcastle.finishedLoading();

});

Setting
“enableLighting” to false does not do anything. I had to set it to null in order
to turn the option off.

Ismir

Ismir,

Shouldn’t it be:

viewer.centralBody.enableLighting = false;

Instead of:

centralBody.enableLighting = false;

Kevin

I tried both

centralBody.enableLighting = false;

Ismir,

Shouldn’t it be:

viewer.centralBody.enableLighting = false;

Instead of:

centralBody.enableLighting = false;

Kevin

I run following code in the Sandbox:
require([‘Cesium’], function(Cesium)
{

"use

strict";

 var gallery =

‘…/…/CesiumViewer/Gallery/’;

 function

createButtons() {

var toolbar = document.getElementById(‘toolbar’);

     var button = document.createElement('button');

button.className = ‘cesium-button’;

button.onclick = function() {

viewer.centralBody.enableLighting = true;

//centralBody.enableLighting = true;

};

button.textContent = ‘Show Lighting’;

toolbar.appendChild(button);

button = document.createElement(‘button’);

button.className = ‘cesium-button’;

button.onclick = function() {

viewer.centralBody.enableLighting = false;

//centralBody.enableLighting = false;

};

button.textContent = ‘Hide Lighting’;

toolbar.appendChild(button);

button = document.createElement(‘button’);

button.className = ‘cesium-button’;

button.onclick = function() {

viewer.centralBody.enableLighting = null;

};

button.textContent = ‘Hide Lighting (null)’;

toolbar.appendChild(button);

}
var viewer =

new Cesium.Viewer(‘cesiumContainer’);

viewer.extend(Cesium.viewerDynamicObjectMixin);

createButtons();
var scene =

viewer.scene;

var centralBody

= scene.getPrimitives().getCentralBody();

Sandcastle.finishedLoading();

});

Setting
“enableLighting” to false does not do anything. I had to set it to null in order
to turn the option off.

Ismir

You received this message because you are subscribed to the Google Groups “cesium-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

viewer.centralBody.enableLighting = false;

You’re right. CentralBody never sets the hidden _enableLighting property when changing the public enableLighting property.

I posted bug report on github.

Ismir,

I submitted a fix: https://github.com/AnalyticalGraphicsInc/cesium/pull/1345

Dan