OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "core/cross/param.h" | 43 #include "core/cross/param.h" |
44 | 44 |
45 namespace o3d { | 45 namespace o3d { |
46 | 46 |
47 class RayIntersectionInfo; | 47 class RayIntersectionInfo; |
48 | 48 |
49 // Defines a class that represents an Axis Aligned Bounding Box. | 49 // Defines a class that represents an Axis Aligned Bounding Box. |
50 class BoundingBox { | 50 class BoundingBox { |
51 public: | 51 public: |
52 // Constructs an uninitialized BoundingBox marking it as non valid. | 52 // Constructs an uninitialized BoundingBox marking it as non valid. |
53 BoundingBox() : min_extent_(0, 0, 0), max_extent_(0, 0, 0), valid_(false) { } | 53 BoundingBox() : valid_(false), min_extent_(0, 0, 0), max_extent_(0, 0, 0) { } |
54 | 54 |
55 // Constructs a BoundingBox. | 55 // Constructs a BoundingBox. |
56 // Parameters: | 56 // Parameters: |
57 // min_extent: minimum corner of the box. | 57 // min_extent: minimum corner of the box. |
58 // max_extent: maximum corner of the box. | 58 // max_extent: maximum corner of the box. |
59 BoundingBox(const Point3& min_extent, const Point3& max_extent) | 59 BoundingBox(const Point3& min_extent, const Point3& max_extent) |
60 : valid_(true), | 60 : valid_(true), |
61 min_extent_(Vectormath::Aos::minPerElem(min_extent, max_extent)), | 61 min_extent_(Vectormath::Aos::minPerElem(min_extent, max_extent)), |
62 max_extent_(Vectormath::Aos::maxPerElem(min_extent, max_extent)) { | 62 max_extent_(Vectormath::Aos::maxPerElem(min_extent, max_extent)) { |
63 } | 63 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 TypedBindConnection<ParamBoundingBox>* destination_bind_connection_; | 173 TypedBindConnection<ParamBoundingBox>* destination_bind_connection_; |
174 | 174 |
175 O3D_DECL_CLASS(ParamBindFloat3sToBoundingBox, ParamBind) | 175 O3D_DECL_CLASS(ParamBindFloat3sToBoundingBox, ParamBind) |
176 DISALLOW_COPY_AND_ASSIGN(ParamBindFloat3sToBoundingBox); | 176 DISALLOW_COPY_AND_ASSIGN(ParamBindFloat3sToBoundingBox); |
177 }; | 177 }; |
178 #endif | 178 #endif |
179 | 179 |
180 } // namespace o3d | 180 } // namespace o3d |
181 | 181 |
182 #endif // O3D_CORE_CROSS_BOUNDING_BOX_H_ | 182 #endif // O3D_CORE_CROSS_BOUNDING_BOX_H_ |
OLD | NEW |