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 Vector3 & | min () const |
const Vector3 & | max () 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=0) const |
bool DD::Image::Box3::empty | ( | ) | const [inline] |
Return true if the box is empty.
Referenced by DD::Image::GeoOp::add_draw_geometry(), DD::Image::GeoOp::build_scene(), expand(), DD::Image::ViewerContext::expand_bbox(), and DD::Image::Scene::validate().
bool DD::Image::Box3::inside | ( | const Vector3 & | p | ) | const [inline] |
Return true if the Vector3 point is inside this box.
References DD::Image::Vector3::x, DD::Image::Vector3::y, and DD::Image::Vector3::z.
Referenced by DD::Image::rTriangle::intersect(), DD::Image::rTriangle::intersect_dist_squared(), and DD::Image::Scene::validate().
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(), max_, MIN(), min_, DD::Image::Vector3::x, DD::Image::Vector3::y, and DD::Image::Vector3::z.
Referenced by DD::Image::Render::_request(), DD::Image::Render::_validate(), DD::Image::ViewerContext::expand_bbox(), DD::Image::Primitive::get_bbox(), transform(), DD::Image::GeoInfo::update_bbox(), 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(), MIN(), DD::Image::Vector3::x, DD::Image::Vector3::y, and DD::Image::Vector3::z.
void Box3::transform | ( | const Matrix4 & | m | ) |
Transform each corner of the box by the matrix, merging them into a new axis-aligned box.
References DD::Image::Matrix4::a03, DD::Image::Matrix4::a13, DD::Image::Matrix4::a23, expand(), max_, min_, t(), DD::Image::Matrix4::vtransform(), DD::Image::Vector3::x, DD::Image::Vector3::y, and DD::Image::Vector3::z.
Referenced by DD::Image::GeoOp::add_draw_geometry(), DD::Image::GeoOp::build_scene(), DD::Image::ViewerContext::expand_bbox(), and DD::Image::Scene::validate().
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(), DD::Image::Vector3::x, DD::Image::Vector3::y, and DD::Image::Vector3::z.
Referenced by DD::Image::Scene::validate().
©2009 The Foundry Visionmongers, Ltd. All Rights Reserved. |