32 explicit RndCam(
const char *pszName);
48 void *
operator new(
size_t nSize) {
57 void operator delete(
void *pBlock) {
70 return new RndCam(pszName);
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Six-plane view volume.
Definition frustum.h:16
Text output stream.
Definition prnstream.h:16
void SetFrustum(float fNear, float fFar, float fFov)
Set the view volume.
const Transform & GetInvWorldXfm() const
Definition rndcam.h:304
static RndObject * New(const char *pszName)
Create a camera.
Definition rndcam.h:69
~RndCam() override
Release the camera and stop drawing through it.
int DrawShowing() override
Make the camera current.
static int sRev
The format version Save() writes and Load() accepts.
Definition rndcam.h:291
RndCam(const char *pszName)
Construct a camera looking along y with a quarter-turn field of view, from 1 to 1000 units.
float GetFov() const
Definition rndcam.h:299
static float ConvertFov(float fFrom, float fTo, float fFov)
Report the field of view that covers the same extent at another aspect.
const Frustum & GetWorldFrustum() const
Definition rndcam.h:339
void DumpText(PrnStream &stream) override
Write a description of the camera and its bases.
Transform mInvWorldProject
Definition rndcam.h:384
RndTex * mTargetTex
Definition rndcam.h:400
static void CreateDefault()
Create the internal camera [default cam], 150 units back along y.
float mFarPlane
Definition rndcam.h:392
static const char * sClassName
The class name a .rnd file writes, Cam.
Definition rndcam.h:283
float GetNearPlane() const
Definition rndcam.h:314
void Save(BinStream &stream) override
Write the camera and its bases.
void SetTargetTex(RndTex *pTex)
Render into a texture rather than the display, or stop.
void Copy(const RndObject *pSource, int nFlags) override
Copy another camera and its bases.
void SetZRange(const Vector2 &range)
Definition rndcam.h:349
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it.
Transform mLocalProject
Definition rndcam.h:378
const Rect & GetScreenRect() const
Definition rndcam.h:324
Rect mScreenRect
Definition rndcam.h:398
Transform mOrthoWorldXfm
Definition rndcam.h:374
Vector2 mZRange
Definition rndcam.h:396
Frustum mWorldFrustum
Definition rndcam.h:388
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace a referenced object with another.
Transform mInvWorldXfm
Definition rndcam.h:376
float mFov
Definition rndcam.h:394
const char * ClassName() const override
Report the class name.
Definition rndcam.h:161
static RndCam * sDefault
The internal camera CreateDefault() made.
Definition rndcam.h:275
Transform mInvLocalProject
Definition rndcam.h:380
RndTex * GetTargetTex() const
Definition rndcam.h:334
Frustum mLocalFrustum
Definition rndcam.h:386
void WorldToScreen(const Vector3 &world, Vector2 &screen) const
Project a world point to a screen point through mWorldProject and mScreenRect.
const Transform & GetLocalProject() const
Definition rndcam.h:309
void ListDrawObjects(std::list< RndObject * > &objects) override
Add the camera itself to a list.
void SetScreenRect(const Rect &rect)
Definition rndcam.h:329
float GetFarPlane() const
Definition rndcam.h:294
int UpdateWorldXfm(RndTransformable *pParent, int bForce) override
Recompute the world transform, and the world projection when it changed.
void UpdateProjection()
Rebuild the local projection and the local view volume, then the world projection.
void ListDrawables(std::list< RndDrawable * > &drawables) override
Make the camera current and add the drawables of the children to a list.
void UpdateWorldProject()
Rebuild the world projection and the world view volume from the world transform.
void AcquireTargetTex()
Take a reference on mTargetTex and rebuild the projection.
const Vector2 & GetZRange() const
Definition rndcam.h:344
void ReleaseTargetTex()
Drop the reference on mTargetTex.
Transform mWorldProject
Definition rndcam.h:382
float mNearPlane
Definition rndcam.h:390
void Collide(const Vector2 &point, std::list< Collision > &collisions) override
Record the camera as struck when a screen point falls inside mScreenRect, then test the children.
static RndCam * sCurrent
The camera drawing is set up for.
Definition rndcam.h:267
const Transform & GetOrthoWorldXfm() const
Definition rndcam.h:319
virtual void Collide(const Segment &segment, std::list< Collision > &collisions)
Test a segment against the collideable and add what it strikes to a list.
RndCollideable()
Construct a collideable without children.
Definition rndcollideable.h:34
RndDrawable()
Construct a showing drawable without a highlight or children.
Definition rnddrawable.h:23
RndObject(const char *pszName)
Construct an object and register it under a name.
Texture, a bitmap loaded from a file or rendered to.
Definition rndtex.h:17
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.
Axis-aligned rectangle given by a corner and a size.
Definition rect.h:11
Two-component vector, used for texture coordinates.
Definition vector2.h:12
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14