diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-01-24 03:49:16 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-01-24 03:49:16 (GMT) |
commit | a563c84bcfc36c3c2ab165386df3483b4063768b (patch) | |
tree | ffad918f5eeca657a0bc4a6ed598b4a63b67ca3a /src/linalg.h | |
parent | 44af912be83d37ff2ef90c084d70b25b358d6d72 (diff) |
move bounding box helper functions to linalg. put bbox code in export_png
Diffstat (limited to 'src/linalg.h')
-rw-r--r-- | src/linalg.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/linalg.h b/src/linalg.h index 48960b7..129ed3f 100644 --- a/src/linalg.h +++ b/src/linalg.h @@ -23,6 +23,19 @@ bool matrix_contains_nan( const Transform3d &m ); BoundingBox operator*(const Transform3d &m, const BoundingBox &box); +Vector3d getBoundingCenter(BoundingBox bbox) +{ + Vector3d center = (bbox.min() + bbox.max()) / 2; + return center; // Vector3d(0,0,0); +} + +double getBoundingRadius(BoundingBox bbox) +{ + double radius = (bbox.max() - bbox.min()).norm() / 2; + return radius; // 0; +} + + class Color4f : public Eigen::Vector4f { public: |