Public Member Functions | |
GridAccel (const vector< Reference< Primitive > > &p, bool forRefined, bool refineImmediately) | |
BBox | WorldBound () const |
bool | CanIntersect () const |
~GridAccel () | |
bool | Intersect (const Ray &ray, Intersection *isect) const |
bool | IntersectP (const Ray &ray) const |
Private Member Functions | |
int | PosToVoxel (const Point &P, int axis) const |
float | VoxelToPos (int p, int axis) const |
Point | VoxelToPos (int x, int y, int z) const |
int | Offset (int x, int y, int z) const |
Private Attributes | |
bool | gridForRefined |
u_int | nMailboxes |
MailboxPrim * | mailboxes |
int | NVoxels [3] |
BBox | bounds |
Vector | Width |
Vector | InvWidth |
Voxel ** | voxels |
ObjectArena< Voxel > | voxelArena |
Static Private Attributes | |
static int | curMailboxId = 0 |
Definition at line 83 of file grid.cpp.
GridAccel::GridAccel | ( | const vector< Reference< Primitive > > & | p, | |
bool | forRefined, | |||
bool | refineImmediately | |||
) |
Definition at line 122 of file grid.cpp.
References StatsPercentage::Add(), StatsRatio::Add(), Voxel::AddPrimitive(), AllocAligned(), Assert, bounds, Clamp(), Primitive::FullyRefine(), InvWidth, mailboxes, StatsCounter::Max(), BBox::MaximumExtent(), nMailboxes, Voxel::nPrimitives, NVoxels, Offset(), BBox::pMax, BBox::pMin, PosToVoxel(), Round2Int(), Union(), voxelArena, voxels, Width, and WorldBound().
GridAccel::~GridAccel | ( | ) |
Definition at line 214 of file grid.cpp.
References FreeAligned(), mailboxes, nMailboxes, NVoxels, voxels, and Voxel::~Voxel().
BBox GridAccel::WorldBound | ( | ) | const [virtual] |
Implements Primitive.
Definition at line 211 of file grid.cpp.
References bounds.
Referenced by GridAccel().
bool GridAccel::CanIntersect | ( | ) | const [inline, virtual] |
bool GridAccel::Intersect | ( | const Ray & | ray, | |
Intersection * | isect | |||
) | const [virtual] |
Implements Primitive.
Definition at line 224 of file grid.cpp.
References StatsRatio::Add(), bounds, curMailboxId, Ray::d, gridForRefined, if(), BBox::Inside(), Voxel::Intersect(), BBox::IntersectP(), Ray::maxt, Ray::mint, NVoxels, Offset(), PosToVoxel(), rayHits, rayTests, voxels, VoxelToPos(), and Width.
bool GridAccel::IntersectP | ( | const Ray & | ray | ) | const [virtual] |
Implements Primitive.
Definition at line 331 of file grid.cpp.
References StatsRatio::Add(), bounds, curMailboxId, Ray::d, gridForRefined, if(), BBox::Inside(), Voxel::IntersectP(), BBox::IntersectP(), Ray::maxt, Ray::mint, NVoxels, Offset(), PosToVoxel(), rayHits, rayTests, voxels, VoxelToPos(), and Width.
int GridAccel::PosToVoxel | ( | const Point & | P, | |
int | axis | |||
) | const [inline, private] |
Definition at line 95 of file grid.cpp.
References bounds, Clamp(), Float2Int(), InvWidth, NVoxels, and BBox::pMin.
Referenced by GridAccel(), Intersect(), and IntersectP().
float GridAccel::VoxelToPos | ( | int | p, | |
int | axis | |||
) | const [inline, private] |
Definition at line 100 of file grid.cpp.
References bounds, BBox::pMin, and Width.
Referenced by Intersect(), and IntersectP().
Point GridAccel::VoxelToPos | ( | int | x, | |
int | y, | |||
int | z | |||
) | const [inline, private] |
int GridAccel::Offset | ( | int | x, | |
int | y, | |||
int | z | |||
) | const [inline, private] |
Definition at line 107 of file grid.cpp.
References NVoxels.
Referenced by GridAccel(), Intersect(), and IntersectP().
bool GridAccel::gridForRefined [private] |
u_int GridAccel::nMailboxes [private] |
MailboxPrim* GridAccel::mailboxes [private] |
int GridAccel::NVoxels[3] [private] |
Definition at line 114 of file grid.cpp.
Referenced by GridAccel(), Intersect(), IntersectP(), Offset(), PosToVoxel(), and ~GridAccel().
BBox GridAccel::bounds [private] |
Definition at line 115 of file grid.cpp.
Referenced by GridAccel(), Intersect(), IntersectP(), PosToVoxel(), VoxelToPos(), and WorldBound().
Vector GridAccel::Width [private] |
Definition at line 116 of file grid.cpp.
Referenced by GridAccel(), Intersect(), IntersectP(), and VoxelToPos().
Vector GridAccel::InvWidth [private] |
Voxel** GridAccel::voxels [private] |
Definition at line 117 of file grid.cpp.
Referenced by GridAccel(), Intersect(), IntersectP(), and ~GridAccel().
ObjectArena<Voxel> GridAccel::voxelArena [private] |
int GridAccel::curMailboxId = 0 [static, private] |