Global

Members

#pxlEnums :Object

Description:
  • pxlNav Enums

    When a 'type' needs to be determined, enums help to show the available options.

    Please see the pxlEnums class document for all the enum values.

Source:
Properties:
Name Type Description
pxlEnums Object

pxlNav {Enums} contains all the enums used in pxlNav

VERBOSE_LEVEL Object

Console logging levels

ANTI_ALIASING Object

Anti-aliasing settings

RENDER_LAYER Object

Render Order Layers

SKY_HAZE Object

Sky Haze settings

SHADOW_MAP Object

Shadow edge softness settings

CAMERA_EVENT Object

Camera event types

COLLIDER_TYPE Object

Collider internal types

GEOMETRY_SIDE Object

Geometry side types

COLOR_SHIFT Object

Color space conversion options

USER_SPEED Object

User speed settings

DEVICE_TYPE Object

Input-Device Types

DEVICE_EVENT Object

Input-Device Events

DEVICE_BUTTON Object

Input-Device Buttons

DEVICE_ACTION Object

Input-Device Actions

HUD_ELEMENT Object

GUI & HUD Element types

HUD_ACTION Object

GUI & HUD Element actions

HUD_DRAW Object

GUI & HUD Element draw types

pxlNav Enums

When a 'type' needs to be determined, enums help to show the available options.

Please see the pxlEnums class document for all the enum values.

Type:
  • Object

pxlOptions

Description:
  • Default options for pxlNav

    Pass a pxlOptions object to the pxlNav constructor to override these defaults.

Source:
Properties:
Name Type Description
verbose number

Verbosity level for console logging

fps object

Frames per second settings

Properties
Name Type Description
pc number

FPS for desktop

mobile number

FPS for mobile

staticCamera boolean

Whether the camera is static

autoCamera boolean

Whether the camera is automatically controlled

allowStaticRotation boolean

Whether static rotation is allowed

userSettings pxlUserSettings

User settings for pxlNav; set to a pxlUserSettings object

subTickCalculations boolean

Whether to calculate sub-ticks

pxlRoomRoot string

Path to room assets

pxlAssetRoot string

Path to asset assets

showOnboarding boolean

Whether to show onboarding

onboarding object

Onboarding settings

Properties
Name Type Description
pc object

Onboarding settings for desktop

Properties
Name Type Description
message string

Onboarding message for desktop

messageStyle Array.<string>

Onboarding message style for desktop

buttonText string

Onboarding button text for desktop

buttonStyle Array.<string>

Onboarding button style for desktop

mobile object

Onboarding settings for mobile

Properties
Name Type Description
message string

Onboarding message for mobile

messageStyle Array.<string>

Onboarding message style for mobile

buttonText string

Onboarding button text for mobile

buttonStyle Array.<string>

Onboarding button style for mobile

loaderPhrases Array.<string>

Loader phrases

antiAliasing string

Anti-aliasing level

collisionScale object

Collision scale settings

Properties
Name Type Description
gridSize number

Grid size for collision

gridReference number

Grid reference for collision

shadowMapBiasing string

Shadow map biasing level

LoadEnvAssetFile boolean

Whether to load environment asset file

skyHaze string

Sky haze level

postProcessPasses object

Post-process passes settings

Properties
Name Type Description
roomGlowPass boolean

Whether to enable room glow pass

mapComposerWarpPass boolean

Whether to enable map composer warp pass

chromaticAberrationPass boolean

Whether to enable chromatic aberration pass

lizardKingPass boolean

Whether to enable lizard king pass

starFieldPass boolean

Whether to enable star field pass

crystallinePass boolean

Whether to enable crystalline pass

Default options for pxlNav

Pass a pxlOptions object to the pxlNav constructor to override these defaults.

Examples
// Example usage
 import { pxlNav, pxlOptions } from './pxlNav.js';

// Project name
const projectTitle = "Test Project";

// Booting rooms
const startingRoom = "YourEnvironment";
const bootRoomList = [startingRoom];

// Target FPS (Frames Per Second)
//   Default is - PC = 60  -&-  Mobile = 30
const targetFPS = {
  'pc' : 45,
  'mobile' : 30
};

// Copy the default options
let pxlNavOptions = Object.assign({},pxlOptions);
pxlNavOptions.fps = targetFPS;

const pxlNavEnv = new pxlNav( pxlNavOptions, projectTitle, startingRoom, bootRoomList );
pxlNavEnv.init();
export const pxlOptions = {
  'verbose' : pxlEnums.VERBOSE_LEVEL.NONE,
  'fps' : {
     'pc' : 60,
     'Mobile' : 30
   },
  'staticCamera' : false,
  'autoCamera' : false,
  'allowStaticRotation' : false,
  'userSettings' : Object.assign({}, pxlUserSettings),
  'subTickCalculations' : false,
  'pxlRoomRoot' : "./pxlRooms",
  'pxlAssetRoot' : "./pxlAssets",
  'showOnboarding' : true,
  'onboarding' : {
     'pc' : {
        'message' : "Welcome to<br>%projectTitle%",
        'messageStyle' : ['pxlGui-welcome-message'],
        'buttonText' : "close",
        'buttonStyle' : ['guiButton']
      },
     'mobile' : {
        'message' : "Welcome to<br>%projectTitle%",
        'messageStyle' : ['pxlGui-mobile-body'],
        'buttonText' : "start",
        'buttonStyle' : ['guiButton', 'pxlGui-mobile-welcomeButton']
      }
   },
  'loaderPhrases' : ['...loading the pixels...'],
  'antiAliasing' : pxlEnums.ANTI_ALIASING.LOW,
  'collisionScale' : {
     'gridSize' : 50,
     'gridReference' : 1000
   },
  'shadowMapBiasing' : pxlEnums.SHADOW_MAP.BASIC,
  'LoadEnvAssetFile' : false,
  'skyHaze' : pxlEnums.SKY_HAZE.OFF,
  'postProcessPasses' : { // Enabling these use assets from ` pxlAssetRoot : './pxlAssets' `
     'roomGlowPass' : false,
     'mapComposerWarpPass' : false,
     'chromaticAberrationPass' : false,
     'lizardKingPass' : false,
     'starFieldPass' :  false,
     'crystallinePass' : false
   }
}

pxlUserSettings

Description:
  • User settings for pxlNav

Source:
Properties:
Name Type Description
height object

User height settings

Properties
Name Type Description
standing number

Standing height in units; any camera in your room's FBX will override this height once loaded

stepSize number

Max step height in units

movement object

User movement settings

Properties
Name Type Description
scalar number

Overall movement rate scalar

max number

Max movement speed

easing number

Easing rate between Step() calls

look object

User look settings

Properties
Name Type Description
pc boolean

Look settings for desktop

Properties
Name Type Description
invert boolean

Invert ( Southpaw ) look on desktop

mobile boolean

Look settings for mobile

Properties
Name Type Description
invert boolean

Invert look on mobile

headBounce object

User head bounce settings

Properties
Name Type Description
height number

Bounce magnitude in units

rate number

Bounce rate per Step()

easeIn number

When move key is pressed, the ease into bounce; bounce * ( boundInf + easeIn )

easeOut number

When move key is let go, the ease back to no bounce; bounce * easeOut

jump object

User jump settings

Properties
Name Type Description
impulse number

Jump impulse force applied to the player while holding the jump button

holdMax number

Max influence of holding the jump button on current jump; in seconds

repeatDelay number

Delay between jumps when holding the jump button

gravity object

User gravity settings

Properties
Name Type Description
ups number

Units per Step() per Step()

max number

Max gravity rate

deadZone object

User dead zone settings

Properties
Name Type Description
controller number

Dead zone for controller input, in stick tilt

touch number

Dead zone for touch input, in pixels

xr number

Dead zone for XR input, in hand detection precision

User settings for pxlNav

Examples
// Example usage
 import { pxlNav, pxlUserSettings, pxlOptions } from './pxlNav.js';

// Project name
const projectTitle = "Test Project";

// Booting rooms
const startingRoom = "YourEnvironment";
const bootRoomList = [startingRoom];

// User settings for the default/initial pxlNav environment
//   These can be adjusted from your `pxlRoom` but easily set defaults here
const userSettings = Object.assign({}, pxlUserSettings);
userSettings['height']['standing'] = 1.75; // Standing height in units; any camera in your room's FBX will override this height once loaded
userSettings['height']['stepSize'] = 5; // Max step height in units

// Copy the default options
let pxlNavOptions = Object.assign({},pxlOptions);
pxlNavOptions.userSettings = userSettings;

const pxlNavEnv = new pxlNav( pxlNavOptions, projectTitle, startingRoom, bootRoomList );
pxlNavEnv.init();
export const pxlUserSettings = {
  'height' : {
     'standing' : 1.75, // Standing height in units; any camera in your room's FBX will override this height once loaded
     'stepSize' : 5 // Max step height in units
   },
  'movement' : {
     'scalar' : 1.0, // Overall movement rate scalar
     'max' : 10.0, // Max movement speed
     'easing' : 0.55, // Easing rate between Step() calls
   },
  'look' : {
     'pc' : {
        'invert' : false // Invert ( Southpaw ) look on desktop
      },
     'mobile' : {
        'invert' : false // Invert look on mobile
      }
   },
  'headBounce' : {
     'height' : 0.3, // Bounce magnitude in units
     'rate' : 0.025, // Bounce rate per Step()
     'easeIn' : 0.03, // When move key is pressed, the ease into bounce; `bounce * ( boundInf + easeIn )`
     'easeOut' : 0.95 // When move key is let go, the ease back to no bounce; `bounce * easeOut`
   },
  'jump' : {
     'impulse' : 0.75, // Jump impulse force applied to the player while holding the jump button
     'holdMax' : 2.85, // Max influence of holding the jump button on current jump; in seconds
     'repeatDelay' : 0.08 // Delay between jumps when holding the jump button
   },
  'gravity' : {
     'ups' : 0.3, // Units per Step() per Step()
     'max' : 15.5 // Max gravity rate
   },
  'deadZone' : {
     'controller' : 0.10, // Dead zone for controller input, in stick tilt
     'touch' : 20, // Dead zone for touch input, in pixels
     'xr' : 0.10 // Dead zone for XR input, in hand detection precision
   },
 }