DD::Image::Box3 Class Reference

3D Box More...

Inherited by DD::Image::rPrimitive, and DD::Image::Scene.

Public Member Functions

 Box3 (float x, float y, float z)
 
 Box3 (const Vector3 p)
 
 Box3 (const Vector3 p1, const Vector3 p2)
 
const Vector3min () const
 
const Vector3max () const
 
float x () const
 
float y () const
 
float n () const
 near, min z
 
float r () const
 right, max x
 
float t () const
 top, max y
 
float f () const
 far, max z
 
float w () const
 width
 
float h () const
 height
 
float d () const
 depth
 
Vector3 center () const
 
float radius () const
 
void set (float x, float y, float z, float r, float t, float f)
 
void set (Vector3 p1, Vector3 p2)
 
void set (const Box3 &v)
 
void set_min (float x, float y, float z)
 
void set_max (float x, float y, float z)
 
bool empty () const
 
void clear ()
 
bool inside (const Vector3 &p) const
 
void expand (const Box3 &v)
 
void expand (const Vector3 &p)
 
void intersect (const Box3 &v)
 
void transform (const Matrix4 &m)
 
void project (const Matrix4 &m, Box &bbox) const
 
void append (Hash &h) const
 
void print_info (const char *title=nullptr) const
 

Detailed Description

3D Box

Member Function Documentation

bool DD::Image::Box3::empty ( ) const
inline
bool DD::Image::Box3::inside ( const Vector3 p) const
inline
void Box3::expand ( const Box3 v)

Union the box with box v. If this is empty it is set to the other box, if the other one is empty this is unchanged.

References empty(), MAX(), and MIN().

Referenced by DD::Image::Render::_request(), DD::Image::Render::_validate(), DD::Image::Primitive::get_bbox(), transform(), DD::Image::Scene::validate(), and DD::Image::Iop::vertex_shader().

void Box3::expand ( const Vector3 p)

Expand the bbox to contain p. If it is empty it is set to a zero-size box at p.

References empty(), MAX(), and MIN().

void Box3::transform ( const Matrix4 m)

Transform each corner of the box by the matrix, merging them into a new axis-aligned box.

References expand(), t(), and DD::Image::Matrix4::vtransform().

Referenced by DD::Image::GeoOp::add_draw_geometry(), DD::Image::GeoOp::build_scene(), DD::Image::ViewerContext::expand_bbox(), and DD::Image::Scene::validate().

void Box3::project ( const Matrix4 m,
Box bbox 
) const

Transform each corner of the box by a projection matrix, merging them into 2D bbox. This is typically used to project into screen space. Pass false to 'wnormalize' if the perspective division is not wanted.

References DD::Image::Box::set().

Referenced by DD::Image::Scene::validate().



©2021 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk