NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
mFrustum_c Class Reference

#include <game/mLib/m_frustum.hpp>

Inheritance diagram for mFrustum_c:
[legend]

Description

A view frustum, used to cull objects outside of the camera's field of view.

Definition at line 10 of file m_frustum.hpp.

Public Member Functions

 mFrustum_c ()
 Constructs an empty frustum.
void set (f32 fovy, f32 aspect, f32 n, f32 f, const mMtx_c &cameraMtx)
 Builds a symmetric perspective frustum.
void set (f32 top, f32 bottom, f32 left, f32 right, f32 near, f32 far, const mMtx_c &cameraMtx, bool orthographic)
 Builds an arbitrary perspective or orthographic frustum.
bool intersectSphere (const mSphere_c *sphere) const
 Checks whether the given sphere is at least partially inside the frustum.
bool intersectAABB (const mAABB_c *box) const
 Checks whether the given bounding box is at least partially inside the frustum.

Constructor & Destructor Documentation

◆ mFrustum_c()

mFrustum_c::mFrustum_c ( )
inline

Constructs an empty frustum.

Definition at line 12 of file m_frustum.hpp.

Member Function Documentation

◆ set() [1/2]

void mFrustum_c::set ( f32 fovy,
f32 aspect,
f32 n,
f32 f,
const mMtx_c & cameraMtx )

Builds a symmetric perspective frustum.

Parameters
fovyThe vertical field of view, in degrees.
aspectThe aspect ratio (width / height).
nearThe distance to the near clipping plane.
farThe distance to the far clipping plane.
cameraMtxThe matrix defining the camera's transform in world space.

Definition at line 4 of file m_frustum.cpp.

◆ set() [2/2]

void mFrustum_c::set ( f32 top,
f32 bottom,
f32 left,
f32 right,
f32 near,
f32 far,
const mMtx_c & cameraMtx,
bool orthographic )

Builds an arbitrary perspective or orthographic frustum.

Parameters
topThe top boundary.
bottomThe bottom boundary.
leftThe left boundary.
rightThe right boundary.
nearThe distance to the near clipping plane.
farThe distance to the far clipping plane.
cameraMtxThe matrix defining the camera's transform in world space.
orthographictrue for orthographic projection, false for perspective projection.

Definition at line 11 of file m_frustum.cpp.

◆ intersectSphere()

bool mFrustum_c::intersectSphere ( const mSphere_c * sphere) const

Checks whether the given sphere is at least partially inside the frustum.

Definition at line 93 of file m_frustum.cpp.

◆ intersectAABB()

bool mFrustum_c::intersectAABB ( const mAABB_c * box) const

Checks whether the given bounding box is at least partially inside the frustum.

Definition at line 132 of file m_frustum.cpp.