33
44import {
55 Vector2 ,
6+ Vector3 ,
67 Color ,
78 FogExp2 ,
89 UniformsUtils ,
@@ -28,7 +29,6 @@ export class SaltFlatsEnvironment extends RoomEnvironment{
2829 super ( roomName , assetPath , msRunner , camera , scene , cloud3dTexture ) ;
2930
3031 this . assetPath = assetPath + "Assets/" ;
31- this . assetPath = "./js/pxlRooms/SaltFlatsEnvironment/Assets/" ;
3232
3333 this . sceneFile = this . assetPath + "SaltFlatsEnvironment.fbx" ;
3434 this . animInitCycle = "Walk" ;
@@ -82,9 +82,9 @@ export class SaltFlatsEnvironment extends RoomEnvironment{
8282 }
8383
8484 start ( ) {
85- if ( this . booted ) {
85+ /* if( this.booted ){
8686 this.resetCamera();
87- }
87+ }*/
8888 let animKey = this . animRigName ;
8989 let hasScripted = this . geoList . hasOwnProperty ( 'Scripted' ) ;
9090 if ( this . geoList . hasOwnProperty ( animKey ) && hasScripted && this . geoList [ "Scripted" ] . hasOwnProperty ( "Offset_loc" ) ) {
@@ -114,7 +114,7 @@ export class SaltFlatsEnvironment extends RoomEnvironment{
114114
115115 // Per-Frame Render updates
116116 step ( ) {
117- super . step ( ) ;
117+ // super.step();
118118
119119 // When the Druid Rabbit finishes loading, we'll step the animation here
120120 // Cycle changes occur here as well.
@@ -161,6 +161,47 @@ export class SaltFlatsEnvironment extends RoomEnvironment{
161161 }
162162
163163 // -- -- --
164+
165+
166+ buildDust ( ) {
167+ if ( this . mobile ) return ;
168+
169+ // -- -- --
170+
171+ let systemName = "floatingDust" ;
172+ let dustSystem = new FloatingDust ( this , systemName ) ;
173+
174+ let dustSystemSettings = dustSystem . getSettings ( ) ;
175+ dustSystemSettings [ "vertCount" ] = 800 ; // Point Count
176+ dustSystemSettings [ "pScale" ] = 7.0 ; // Point Base Scale
177+ dustSystemSettings [ "pOpacity" ] = .6 ; // Overall Opacity
178+ dustSystemSettings [ "proxDist" ] = 380 ; // Proximity Distance from Camera
179+ dustSystemSettings [ "fadeOutScalar" ] = 1.9 ; // Distance-opacity falloff multiplier
180+ dustSystemSettings [ "additiveBlend" ] = true ;
181+
182+ dustSystemSettings [ "windDir" ] = new Vector3 ( - 0.9 , 0.25 , - 1 ) ; // Constant direction flow
183+ dustSystemSettings [ "wanderInf" ] = 0.50 ; // How much the particle sways
184+ dustSystemSettings [ "wanderFrequency" ] = 2.30 ; // How frequent the sway happens
185+
186+
187+ dustSystemSettings [ "atlasPicks" ] = [
188+ ...dustSystem . dupeArray ( [ 0.0 , 0. ] , 4 ) , ...dustSystem . dupeArray ( [ 0.25 , 0. ] , 4 ) ,
189+ ...dustSystem . dupeArray ( [ 0.0 , 0.25 ] , 4 ) , ...dustSystem . dupeArray ( [ 0.25 , 0.25 ] , 4 ) ,
190+ ...dustSystem . dupeArray ( [ 0.0 , 0.5 ] , 2 ) , ...dustSystem . dupeArray ( [ 0.25 , 0.5 ] , 2 ) ,
191+ ...dustSystem . dupeArray ( [ 0.0 , 0.75 ] , 3 ) , ...dustSystem . dupeArray ( [ 0.25 , 0.75 ] , 3 )
192+ ] ;
193+
194+ // Use a texture from the internal `pxlAsset` folder; ( RGB, Alpha )
195+ //dustSystem.setAtlasPath( "sprite_dustLiquid_rgb.jpg", "sprite_dustLiquid_alpha.jpg" );
196+
197+ // Generate geometry and load texture resources
198+ dustSystem . build ( dustSystemSettings ) ;
199+
200+ this . particleList [ systemName ] = dustSystem ;
201+ }
202+
203+
204+ // -- -- --
164205
165206
166207 fbxPostLoad ( ) {
@@ -180,12 +221,7 @@ export class SaltFlatsEnvironment extends RoomEnvironment{
180221
181222 // Floating debris in the air
182223
183- let systemName = "floatingDust" ;
184- this . particleList [ systemName ] = new FloatingDust ( this , systemName ) ;
185- let atlasPath = this . assetPath + "sprite_dustLiquid.png"
186-
187- this . particleList [ systemName ] . setAtlasPath ( atlasPath ) ;
188- this . particleList [ systemName ] . build ( 1000 , 10 , 120 , [ - 40 , - 10 , 0 ] , [ 0.0 , 5.0 ] , [ [ .25 , 0 ] , [ .25 , .25 ] ] , false ) ;
224+ this . buildDust ( ) ;
189225
190226 // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
191227
0 commit comments