99// For `pxlNav` scripting, the entry-point is `./Source/js/pxlNavCore.js`
1010//
1111
12- import { pxlNav , pxlNavVersion , pxlEnums , pxlOptions } from './pxlNav.esm.js' ;
12+ import { pxlNav , pxlNavVersion , pxlEnums , pxlUserSettings , pxlOptions } from './pxlNav.esm.js' ;
1313import { ProcPages } from './ProcPages.js' ;
1414import { PageMetaDataObjects } from './PageMetaData.js' ;
1515import { BlogManager } from './BlogManager.js' ;
@@ -27,8 +27,13 @@ const projectTitle = "procstack.github.io";
2727// pxlRoom folder path, available to change folder names or locations if desired
2828const pxlRoomRootPath = "./pxlRooms" ;
2929
30+ // Asset root path
31+ const pxlAssetRoot = "./pxlAssets" ;
32+
33+ // Show the onboarding screen after the loading bar completes
34+ const showOnboarding = false ;
35+
3036// Current possible rooms - "CampfireEnvironment", "SaltFlatsEnvironment"
31- const startingRoom = "CampfireEnvironment" ;
3237const bootRoomList = [ "CampfireEnvironment" , "SaltFlatsEnvironment" ] ;
3338
3439// -- -- --
@@ -48,6 +53,33 @@ const loaderPhrases = [
4853
4954// -- -- --
5055
56+ // User settings for the default/initial pxlNav environment
57+ // These can be adjusted from your `pxlRoom` but easily set defaults here
58+ const userSettings = Object . assign ( { } , pxlUserSettings ) ;
59+ userSettings [ 'height' ] [ 'standing' ] = 1.75 ; // Standing height in units; any camera in your room's FBX will override this height once loaded
60+ userSettings [ 'height' ] [ 'stepSize' ] = 5 ; // Max step height in units
61+ userSettings [ 'movement' ] [ 'scalar' ] = 1.0 ; // Overall movement rate scalar
62+ userSettings [ 'movement' ] [ 'max' ] = 10.0 ; // Max movement speed
63+ userSettings [ 'movement' ] [ 'easing' ] = 0.55 ; // Easing rate between Step() calls
64+ userSettings [ 'headBounce' ] [ 'height' ] = 0.3 ; // Bounce magnitude in units
65+ userSettings [ 'headBounce' ] [ 'rate' ] = 0.025 ; // Bounce rate per Step()
66+ userSettings [ 'headBounce' ] [ 'easeIn' ] = 0.03 ; // When move key is pressed, the ease into bounce; `bounce * ( boundInf + easeIn )`
67+ userSettings [ 'headBounce' ] [ 'easeOut' ] = 0.95 ; // When move key is let go, the ease back to no bounce; `bounce * easeOut`
68+ userSettings [ 'jump' ] [ 'impulse' ] = 0.75 ; // Jump impulse force applied to the player while holding the jump button
69+ userSettings [ 'jump' ] [ 'holdMax' ] = 2.85 ; // Max influence of holding the jump button on current jump; in seconds
70+ userSettings [ 'jump' ] [ 'repeatDelay' ] = 0.08 ; // Delay between jumps when holding the jump button
71+ userSettings [ 'gravity' ] [ 'UPS' ] = 0.3 ; // Units per Step() per Step()
72+ userSettings [ 'gravity' ] [ 'Max' ] = 15.5 ; // Max gravity rate
73+
74+ // -- -- --
75+
76+ // Target FPS (Frames Per Second)
77+ // Default is - PC = 30 -&- Movile = 30
78+ const targetFPS = {
79+ 'PC' : 60 ,
80+ 'Mobile' : 30
81+ } ;
82+
5183// Anti-aliasing level
5284// Options are - NONE, LOW, MEDIUM, HIGH
5385const antiAliasing = pxlEnums . ANTI_ALIASING . LOW ;
@@ -65,7 +97,14 @@ const enableStaticCamera = true;
6597// Options are - OFF, VAPOR
6698const skyHaze = pxlEnums . SKY_HAZE . VAPOR ;
6799
68-
100+ // Collision Detection Grid
101+ // Collision objects are split into a grid for faster collision detection
102+ // gridSize - The size of the grid
103+ // gridReference - Grid scene reference threshold to scale `gridSize`
104+ const collisionScale = {
105+ 'gridSize' : 100 ,
106+ 'gridReference' : 1000
107+ } ;
69108
70109
71110// -- -- -- -- --
@@ -101,9 +140,14 @@ procBlog.showEntry(-1);
101140
102141let pxlNavOptions = Object . assign ( { } , pxlOptions ) ;
103142pxlNavOptions . verbose = verbose ;
143+ pxlNavOptions . fps = targetFPS ;
144+ pxlNavOptions . userSettings = userSettings ;
104145pxlNavOptions . antiAliasing = antiAliasing ;
105- pxlNavOptions . staticCamera = enableStaticCamera ;
146+ pxlNavOptions . collisionScale = collisionScale ;
106147pxlNavOptions . pxlRoomRoot = pxlRoomRootPath ;
148+ pxlNavOptions . pxlAssetRoot = pxlAssetRoot ;
149+ pxlNavOptions . showOnboarding = showOnboarding ;
150+ pxlNavOptions . staticCamera = enableStaticCamera ;
107151pxlNavOptions . skyHaze = skyHaze ;
108152pxlNavOptions . shadowMapBiasing = shadowMapBiasing ;
109153pxlNavOptions . loaderPhrases = loaderPhrases ;
0 commit comments