49 void *
operator new(
size_t nSize) {
50 return PoolMemAlloc(
static_cast<int>(nSize),
"Light", 0);
58 void operator delete(
void *pBlock) {
105 virtual void SetAngles(
float fInnerAng,
float fOuterAng) {
106 mOuterAng = fOuterAng;
107 mInnerAng = fInnerAng;
122 mQuadraticAtten = fQuadratic;
123 mConstantAtten = fConstant;
124 mLinearAtten = fLinear;
263 float mConstantAtten;
265 float mQuadraticAtten;
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Text output stream.
Definition prnstream.h:16
virtual void SetAttenuation(float fConstant, float fLinear, float fQuadratic)
Set the attenuation.
Definition rndlight.h:121
static void CreateDefault()
Create the default light, add it to the default environment, and place it under the default camera.
static RndLight * sDefault
The light CreateDefault() made.
Definition rndlight.h:225
static int sRev
The format version Save() writes and Load() accepts.
Definition rndlight.h:241
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it, then pass the settings to the back end.
int GetType() const
Definition rndlight.h:254
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace a referenced object with another in the base.
static const char * sClassName
The class name a .rnd file writes, Light.
Definition rndlight.h:233
virtual void Sync()
Pass the settings to the back end.
Definition rndlight.h:135
const Color & GetColor() const
Definition rndlight.h:244
virtual void SetColor(const Color &color)
Set the colour.
Definition rndlight.h:69
void Save(BinStream &stream) override
Write the light and its base.
void DumpText(PrnStream &stream) override
Write a description of the light and its base.
static RndObject * New(const char *pszName)
Create a light.
Definition rndlight.h:215
void Copy(const RndObject *pSource, int nFlags) override
Copy another light and its base, then pass the settings to the back end.
virtual void SetRange(float fRange)
Set the range.
Definition rndlight.h:91
RndLight(const char *pszName)
Construct a white directional light with a range of 1000, cone angles of a quarter turn,...
~RndLight() override
Destroy the light.
float GetRange() const
Definition rndlight.h:249
virtual void SetType(int nType)
Set the kind of light.
Definition rndlight.h:80
virtual void SetAngles(float fInnerAng, float fOuterAng)
Set the angles of the cone of a spot light.
Definition rndlight.h:105
const char * ClassName() const override
Report the class name.
Definition rndlight.h:173
Type
The kinds of light.
Definition rndlight.h:19
@ kTypePoint
Definition rndlight.h:20
@ kTypeDirectional
Definition rndlight.h:21
@ kTypeSpot
Definition rndlight.h:22
RndObject(const char *pszName)
Construct an object and register it under a name.
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
PrnStream & operator<<(PrnStream &stream, RndLight::Type eType)
Write the name of a kind of light.
Linear colour with four float components.
Definition color.h:12