resonance 1.0.1
Loading...
Searching...
No Matches
frustum.h File Reference
#include "math/plane.h"
Include dependency graph for frustum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Frustum
 Six-plane view volume. More...

Namespaces

namespace  Rnd
 The rendering engine.

Functions

Rnd::Dbg & operator<< (Rnd::Dbg &sink, const Frustum &frustum)
 Write the six planes of a view volume to a diagnostic sink.
int IsSphereOutsideFrustum (const Sphere &sphere, const Frustum &frustum)
 Report whether a sphere lies wholly outside at least one plane of a view volume.

Variables

constexpr int kVu0StatusStickySign = 0x80
 Bit of the VU0 status flag IsSphereOutsideFrustum() reports, the sticky sign flag.

Function Documentation

◆ operator<<()

Rnd::Dbg & operator<< ( Rnd::Dbg & sink,
const Frustum & frustum )

Write the six planes of a view volume to a diagnostic sink.

Each plane goes on its own tab-indented line under its title, as (a: b: c: d:) with two decimals. Rnd::Cam::DumpText() is the one caller.

Parameters
sinkThe sink to write to.
frustumThe view volume.
Returns
The sink.
Ghidra address:
NTSC-U/C: 0x0054f798
Ghidra address:
PAL: 0x0058fdd8

◆ IsSphereOutsideFrustum()

int IsSphereOutsideFrustum ( const Sphere & sphere,
const Frustum & frustum )

Report whether a sphere lies wholly outside at least one plane of a view volume.

Each plane is dotted with the centre and the radius added, on VU0 in macro mode, and the sticky sign bit of the status flag collects a negative sum from every plane. The bit is returned as it stands rather than as a truth value. Rnd::Mesh::PrepareDraw() is the one caller, and it passes the world frustum of the camera.

Parameters
sphereThe sphere, in the space the planes are expressed in.
frustumThe view volume.
Returns
kVu0StatusStickySign when the whole sphere is behind some plane, and zero otherwise.
Ghidra address:
NTSC-U/C: 0x005513a8
Ghidra address:
PAL: 0x005919e8

Variable Documentation

◆ kVu0StatusStickySign

int kVu0StatusStickySign = 0x80
constexpr

Bit of the VU0 status flag IsSphereOutsideFrustum() reports, the sticky sign flag.