diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/bounds.h')
-rw-r--r-- | 3rdparty/bgfx/examples/common/bounds.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/3rdparty/bgfx/examples/common/bounds.h b/3rdparty/bgfx/examples/common/bounds.h index 03cac67ca9a..fcfd1872c48 100644 --- a/3rdparty/bgfx/examples/common/bounds.h +++ b/3rdparty/bgfx/examples/common/bounds.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 Branimir Karadzic. All rights reserved. + * Copyright 2011-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ @@ -67,20 +67,26 @@ struct Intersection void aabbToObb(Obb& _obb, const Aabb& _aabb); /// Convert sphere to axis aligned bounding box. -void sphereToAabb(Aabb& _aabb, const Sphere& _sphere); +void toAabb(Aabb& _aabb, const Sphere& _sphere); -/// Calculate surface area of axis aligned bounding box. -float calcAabbArea(Aabb& _aabb); +/// Convert disk to axis aligned bounding box. +void toAabb(Aabb& _aabb, const Disk& _disk); + +/// Convert cylinder to axis aligned bounding box. +void toAabb(Aabb& _aabb, const Cylinder& _cylinder); /// Calculate axis aligned bounding box. -void calcAabb(Aabb& _aabb, const void* _vertices, uint32_t _numVertices, uint32_t _stride); +void toAabb(Aabb& _aabb, const void* _vertices, uint32_t _numVertices, uint32_t _stride); /// Transform vertices and calculate axis aligned bounding box. -void calcAabb(Aabb& _aabb, const float* _mtx, const void* _vertices, uint32_t _numVertices, uint32_t _stride); +void toAabb(Aabb& _aabb, const float* _mtx, const void* _vertices, uint32_t _numVertices, uint32_t _stride); /// Expand AABB. void aabbExpand(Aabb& _aabb, float _factor); +/// Calculate surface area of axis aligned bounding box. +float calcAreaAabb(const Aabb& _aabb); + /// Returns 0 is two AABB don't overlap, otherwise returns flags of overlap /// test. uint32_t aabbOverlapTest(const Aabb& _aabb0, const Aabb& _aabb1); @@ -94,9 +100,6 @@ void calcMaxBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num /// Calculate minimum bounding sphere. void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step = 0.01f); -/// Calculate coplanar U/V vectors. -void calcPlaneUv(const Plane& _plane, float* _udir, float* _vdir); - /// Returns 6 (near, far, left, right, top, bottom) planes representing frustum planes. void buildFrustumPlanes(Plane* _planes, const float* _viewProj); |