wavelength 1.0.0
Loading...
Searching...
No Matches
frustum.h File Reference
#include "math/plane.h"
#include "os/prnstream.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...

Functions

PrnStream & operator<< (PrnStream &stream, const Frustum &frustum)
 Write the six planes of a view volume.
int IsSphereOutsideFrustum (const Sphere &sphere, const Frustum &frustum)
 Report whether a sphere lies wholly outside at least one plane of a view volume.
bool IsPointInsideFrustum (const Vector3 &point, const Frustum &frustum)
 Report whether a point lies on the inner side of every 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<<()

PrnStream & operator<< ( PrnStream & stream,
const Frustum & frustum )

Write the six planes of a view volume.

Each plane goes on its own tab-indented line under its title.

Parameters
streamThe stream to write to.
frustumThe view volume.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x002904e0
Ghidra address:
PAL: 0x00299ea8

◆ 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.

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: 0x00290f90
Ghidra address:
PAL: 0x0029a958

◆ IsPointInsideFrustum()

bool IsPointInsideFrustum ( const Vector3 & point,
const Frustum & frustum )

Report whether a point lies on the inner side of every plane of a view volume.

Parameters
pointThe point, in the space the planes are expressed in.
frustumThe view volume.
Returns
Whether no plane puts the point behind it.
Ghidra address:
NTSC-U/C: 0x00291090
Ghidra address:
PAL: 0x0029aa58

Variable Documentation

◆ kVu0StatusStickySign

int kVu0StatusStickySign = 0x80
constexpr

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