File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,20 +158,19 @@ class View extends Component {
158158 //ambient light doesn't have an indicator
159159 switch ( ent . light . type ) {
160160 case "point" :
161- return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } pointlightindicator = { `color: ${ ent . color } ;` } > </ a-entity > ;
161+ return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } pointlightindicator = { `color: ${ ent . color } ;` } layer = "type:group; layer:1" > </ a-entity > ;
162162 case "spot" :
163163 let target = true ;
164164 if ( ! ent . light . target ) {
165165 position = "" ;
166166 target = false ;
167167 }
168- return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } spotlightindicator = { `color: ${ ent . color } ; target:${ target } ` } indicatorrotation = { position } > </ a-entity > ;
168+ return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } spotlightindicator = { `color: ${ ent . color } ; target:${ target } ` } indicatorrotation = { position } layer = "type:group; layer:1" > </ a-entity > ;
169169 case "directional" :
170- return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } directionallightindicator = { `color: ${ ent . color } ;` } indicatorrotation = { position } > </ a-entity > ;
170+ return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } directionallightindicator = { `color: ${ ent . color } ;` } indicatorrotation = { position } layer = "type:group; layer:1" > </ a-entity > ;
171171 case "hemisphere" :
172- return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } hemispherelightindicator = { `color: ${ ent . color } ; secondColor: ${ ent . light . secondColor } ` } > </ a-entity > ;
172+ return < a-entity id = { ent . id + "Ind" } key = { ent . id + "Ind" } hemispherelightindicator = { `color: ${ ent . color } ; secondColor: ${ ent . light . secondColor } ` } layer = "type:group; layer:1" > </ a-entity > ;
173173 default :
174- return null ;
175174 }
176175 }
177176 //return string that contains necessary configuration for shadow based on light's type
Original file line number Diff line number Diff line change @@ -39,7 +39,14 @@ AFRAME.registerComponent("layer",{
3939 } ,
4040 } ,
4141 init : function ( ) {
42- this . el . getObject3D ( this . data . type ) . layers . set ( this . data . layer ) ;
42+ let obj = this . el . getObject3D ( this . data . type ) ;
43+ if ( this . data . type === "group" ) {
44+ obj . children . forEach ( ( child ) => {
45+ child . layers . set ( this . data . layer ) ;
46+ } ) ;
47+ } else {
48+ obj . layers . set ( this . data . layer ) ;
49+ }
4350 }
4451} ) ;
4552
@@ -55,11 +62,11 @@ AFRAME.registerComponent("scenelayer",{
5562 } ,
5663 tick : function ( ) {
5764 this . renderer . autoClear = true ;
58- this . camera . layers . set ( 0 ) ;
65+ this . camera . layers . set ( 1 ) ;
5966 this . renderer . render ( this . scene , this . camera ) ;
6067
6168 this . renderer . autoClear = false ;
62- this . camera . layers . set ( 1 ) ;
69+ this . camera . layers . set ( 0 ) ;
6370 this . renderer . render ( this . scene , this . camera ) ;
6471 }
6572} ) ;
You can’t perform that action at this time.
0 commit comments