提交 ec61bbb7 编写于 作者: M Mr.doob

Editor: Added decay support.

上级 8a1823a5
......@@ -48,14 +48,14 @@ Sidebar.Object3D = function ( editor ) {
break;
}
this.setValue( 'Actions' );
signals.objectChanged.dispatch( object );
} );
container.addStatic( objectActions );
container.add( new UI.Break() );
// uuid
......@@ -228,6 +228,16 @@ Sidebar.Object3D = function ( editor ) {
container.add( objectExponentRow );
// decay
var objectDecayRow = new UI.Panel();
var objectDecay = new UI.Number().setRange( 0, Infinity ).onChange( update );
objectDecayRow.add( new UI.Text( 'Decay' ).setWidth( '90px' ) );
objectDecayRow.add( objectDecay );
container.add( objectDecayRow );
// visible
var objectVisibleRow = new UI.Panel();
......@@ -406,6 +416,12 @@ Sidebar.Object3D = function ( editor ) {
}
if ( object.decay !== undefined ) {
object.decay = objectDecay.getValue();
}
object.visible = objectVisible.getValue();
try {
......@@ -436,7 +452,8 @@ Sidebar.Object3D = function ( editor ) {
'groundColor': objectGroundColorRow,
'distance' : objectDistanceRow,
'angle' : objectAngleRow,
'exponent' : objectExponentRow
'exponent' : objectExponentRow,
'decay' : objectDecayRow
};
for ( var property in properties ) {
......@@ -585,6 +602,12 @@ Sidebar.Object3D = function ( editor ) {
}
if ( object.decay !== undefined ) {
objectDecay.setValue( object.decay );
}
objectVisible.setValue( object.visible );
try {
......
......@@ -251,13 +251,13 @@ THREE.ObjectLoader.prototype = {
case 'PointLight':
object = new THREE.PointLight( data.color, data.intensity, data.distance );
object = new THREE.PointLight( data.color, data.intensity, data.distance, data.decay );
break;
case 'SpotLight':
object = new THREE.SpotLight( data.color, data.intensity, data.distance, data.angle, data.exponent );
object = new THREE.SpotLight( data.color, data.intensity, data.distance, data.angle, data.exponent, data.decay );
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册