Triton
Visual simulation library for ocean rendering.
OrientedBoundingBox.h
Go to the documentation of this file.
1// Copyright (c) 2013-2014 Sundog Software, LLC. All rights reserved worldwide.
2
3#ifndef TRITON_OREINTED_BOUNDING_BOX_H
4#define TRITON_OREINTED_BOUNDING_BOX_H
5
10#include "TritonCommon.h"
11#include "Vector3.h"
12#include "Matrix3.h"
13
14namespace Triton
15{
18{
19public:
22
24 void Set(const Vector3& center, const Vector3& xExtent, const Vector3& yExtent, const Vector3& zExtent);
25
27 bool PointInBox(const Vector3& point, double slop) const;
28
31
32 Vector3 center;
33 Vector3 axes[3];
34 double halfDistances[3];
35 Matrix3 invBasis;
36};
37}
38
39#endif
Implements a 3x3 matrix and its operations.
Common typedefs and defines used within Triton.
A 3D Vector class and its operations.
A simple 3x3 matrix class and its operations.
Definition: Matrix3.h:30
This base class for all Triton objects intercepts the new and delete operators, routing them through ...
Definition: MemAlloc.h:71
An oriented bounding box defined by a center point and three axes.
Definition: OrientedBoundingBox.h:18
void Set(const Vector3 &center, const Vector3 &xExtent, const Vector3 &yExtent, const Vector3 &zExtent)
Define the OBB by a center point and vectors from center to extents in X, Y, and Z.
OrientedBoundingBox()
Constructor.
void RecomputeBasis()
Recomputes the basis used for PointInBox.
bool PointInBox(const Vector3 &point, double slop) const
Test if a point is enclosed by the box.
A 3D double-precision Vector class and its operations.
Definition: Vector3.h:36