@@ -146,6 +146,46 @@ Sidebar.Object = function ( editor ) {
146146
147147 container . add ( objectFovRow ) ;
148148
149+ // left
150+
151+ var objectLeftRow = new UI . Row ( ) ;
152+ var objectLeft = new UI . Number ( ) . onChange ( update ) ;
153+
154+ objectLeftRow . add ( new UI . Text ( strings . getKey ( 'sidebar/object/left' ) ) . setWidth ( '90px' ) ) ;
155+ objectLeftRow . add ( objectLeft ) ;
156+
157+ container . add ( objectLeftRow ) ;
158+
159+ // right
160+
161+ var objectRightRow = new UI . Row ( ) ;
162+ var objectRight = new UI . Number ( ) . onChange ( update ) ;
163+
164+ objectRightRow . add ( new UI . Text ( strings . getKey ( 'sidebar/object/right' ) ) . setWidth ( '90px' ) ) ;
165+ objectRightRow . add ( objectRight ) ;
166+
167+ container . add ( objectRightRow ) ;
168+
169+ // top
170+
171+ var objectTopRow = new UI . Row ( ) ;
172+ var objectTop = new UI . Number ( ) . onChange ( update ) ;
173+
174+ objectTopRow . add ( new UI . Text ( strings . getKey ( 'sidebar/object/top' ) ) . setWidth ( '90px' ) ) ;
175+ objectTopRow . add ( objectTop ) ;
176+
177+ container . add ( objectTopRow ) ;
178+
179+ // bottom
180+
181+ var objectBottomRow = new UI . Row ( ) ;
182+ var objectBottom = new UI . Number ( ) . onChange ( update ) ;
183+
184+ objectBottomRow . add ( new UI . Text ( strings . getKey ( 'sidebar/object/bottom' ) ) . setWidth ( '90px' ) ) ;
185+ objectBottomRow . add ( objectBottom ) ;
186+
187+ container . add ( objectBottomRow ) ;
188+
149189 // near
150190
151191 var objectNearRow = new UI . Row ( ) ;
@@ -400,15 +440,53 @@ Sidebar.Object = function ( editor ) {
400440
401441 }
402442
443+ if ( object . left !== undefined && Math . abs ( object . left - objectLeft . getValue ( ) ) >= 0.01 ) {
444+
445+ editor . execute ( new SetValueCommand ( object , 'left' , objectLeft . getValue ( ) ) ) ;
446+ object . updateProjectionMatrix ( ) ;
447+
448+ }
449+
450+ if ( object . right !== undefined && Math . abs ( object . right - objectRight . getValue ( ) ) >= 0.01 ) {
451+
452+ editor . execute ( new SetValueCommand ( object , 'right' , objectRight . getValue ( ) ) ) ;
453+ object . updateProjectionMatrix ( ) ;
454+
455+ }
456+
457+ if ( object . top !== undefined && Math . abs ( object . top - objectTop . getValue ( ) ) >= 0.01 ) {
458+
459+ editor . execute ( new SetValueCommand ( object , 'top' , objectTop . getValue ( ) ) ) ;
460+ object . updateProjectionMatrix ( ) ;
461+
462+ }
463+
464+ if ( object . bottom !== undefined && Math . abs ( object . bottom - objectBottom . getValue ( ) ) >= 0.01 ) {
465+
466+ editor . execute ( new SetValueCommand ( object , 'bottom' , objectBottom . getValue ( ) ) ) ;
467+ object . updateProjectionMatrix ( ) ;
468+
469+ }
470+
403471 if ( object . near !== undefined && Math . abs ( object . near - objectNear . getValue ( ) ) >= 0.01 ) {
404472
405473 editor . execute ( new SetValueCommand ( object , 'near' , objectNear . getValue ( ) ) ) ;
474+ if ( object . isOrthographicCamera ) {
475+
476+ object . updateProjectionMatrix ( ) ;
477+
478+ }
406479
407480 }
408481
409482 if ( object . far !== undefined && Math . abs ( object . far - objectFar . getValue ( ) ) >= 0.01 ) {
410483
411484 editor . execute ( new SetValueCommand ( object , 'far' , objectFar . getValue ( ) ) ) ;
485+ if ( object . isOrthographicCamera ) {
486+
487+ object . updateProjectionMatrix ( ) ;
488+
489+ }
412490
413491 }
414492
@@ -518,17 +596,21 @@ Sidebar.Object = function ( editor ) {
518596
519597 var properties = {
520598 'fov' : objectFovRow ,
599+ 'left' : objectLeftRow ,
600+ 'right' : objectRightRow ,
601+ 'top' : objectTopRow ,
602+ 'bottom' : objectBottomRow ,
521603 'near' : objectNearRow ,
522604 'far' : objectFarRow ,
523605 'intensity' : objectIntensityRow ,
524606 'color' : objectColorRow ,
525607 'groundColor' : objectGroundColorRow ,
526- 'distance' : objectDistanceRow ,
527- 'angle' : objectAngleRow ,
528- 'penumbra' : objectPenumbraRow ,
529- 'decay' : objectDecayRow ,
530- 'castShadow' : objectShadowRow ,
531- 'receiveShadow' : objectReceiveShadow ,
608+ 'distance' : objectDistanceRow ,
609+ 'angle' : objectAngleRow ,
610+ 'penumbra' : objectPenumbraRow ,
611+ 'decay' : objectDecayRow ,
612+ 'castShadow' : objectShadowRow ,
613+ 'receiveShadow' : objectReceiveShadow ,
532614 'shadow' : objectShadowRadius
533615 } ;
534616
@@ -617,6 +699,30 @@ Sidebar.Object = function ( editor ) {
617699
618700 }
619701
702+ if ( object . left !== undefined ) {
703+
704+ objectLeft . setValue ( object . left ) ;
705+
706+ }
707+
708+ if ( object . right !== undefined ) {
709+
710+ objectRight . setValue ( object . right ) ;
711+
712+ }
713+
714+ if ( object . top !== undefined ) {
715+
716+ objectTop . setValue ( object . top ) ;
717+
718+ }
719+
720+ if ( object . bottom !== undefined ) {
721+
722+ objectBottom . setValue ( object . bottom ) ;
723+
724+ }
725+
620726 if ( object . near !== undefined ) {
621727
622728 objectNear . setValue ( object . near ) ;
0 commit comments