wavelength 1.0.0
Loading...
Searching...
No Matches
psenviron.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/color.h"
4#include "math/sphere.h"
5#include "math/transform.h"
6#include "math/vector3.h"
7#include "rnd/rndenviron.h"
8
17class PsEnviron : public RndEnviron {
18public:
26
34 explicit PsEnviron(const char *pszName) : RndObject(pszName), RndEnviron(pszName) {
35 }
36
41 ~PsEnviron() override {
42 }
43
51 int DrawShowing() override;
52
67 static void SelectLights(const Transform *pXfm, const Sphere *pSphere);
68
78 static void Init();
79
88 static void Terminate();
89
98 static RndObject *New(const char *pszName) {
99 return new PsEnviron(pszName);
100 }
101};
102
109extern float g_fogScale;
110
117extern float g_fogOffset;
118
125extern int g_nFogEnabled;
126
134
140extern Color g_ambientColor;
141
151extern Vector3 g_lightMatrix[3];
152
158extern Color g_lightColors[3];
PsEnviron(const char *pszName)
Construct an environment.
Definition psenviron.h:34
int DrawShowing() override
Set the fog and the lights up for the drawables after the environment, and make it current.
static RndObject * New(const char *pszName)
Create an environment.
Definition psenviron.h:98
static void Init()
Install the environment factory for the class Environ of a .rnd file, and create the default environm...
LightProgram
The VU1 lighting microprograms, by their addresses in VU1 code memory.
Definition psenviron.h:20
@ kLightProgramUnlit
Definition psenviron.h:24
@ kLightProgramPoint
Definition psenviron.h:21
@ kLightProgramDirectional
Definition psenviron.h:22
@ kLightProgramAmbient
Definition psenviron.h:23
~PsEnviron() override
Definition psenviron.h:41
static void SelectLights(const Transform *pXfm, const Sphere *pSphere)
Add the lighting block of the VU1 mesh microprogram to the packet, eight quadwords.
static void Terminate()
Restore the generic environment factory.
RndEnviron(const char *pszName)
Construct an environment without lights, with a black ambient colour and no white fog.
RndObject(const char *pszName)
Construct an object and register it under a name.
Bounding sphere.
Definition sphere.h:17
PsEnviron::LightProgram g_lightProgram
The lighting microprogram of the current environment.
int g_nFogEnabled
Non-zero while the current environment has fog.
Color g_ambientColor
Ambient colour of the current environment, with alpha 1.
float g_fogScale
Scale from a depth to the GS fog range, 255 over the fog distance, or 0 without fog.
float g_fogOffset
Offset of the GS fog range, minus the fog end times g_fogScale, or 255 without fog.
Vector3 g_lightMatrix[3]
The lights of the current environment as a matrix.
Color g_lightColors[3]
Colour of each light of the current environment, with alpha 0.
Linear colour with four float components.
Definition color.h:12
Affine transform stored as three basis rows and a translation row.
Definition transform.h:18
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14