00001 /* 00002 Copyright (c) 2008, Luke Benstead. 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, 00006 are permitted provided that the following conditions are met: 00007 00008 * Redistributions of source code must retain the above copyright notice, 00009 this list of conditions and the following disclaimer. 00010 * Redistributions in binary form must reproduce the above copyright notice, 00011 this list of conditions and the following disclaimer in the documentation 00012 and/or other materials provided with the distribution. 00013 00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00015 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00016 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00017 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 00018 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00019 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00020 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00021 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00022 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00023 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 */ 00025 00026 #ifndef KAZMATH_AABB_H_INCLUDED 00027 #define KAZMATH_AABB_H_INCLUDED 00028 00029 #include "vec3.h" 00030 #include "utility.h" 00031 00032 #ifdef __cplusplus 00033 extern "C" { 00034 #endif 00035 00040 typedef struct kmAABB { 00041 kmVec3 min; 00042 kmVec3 max; 00043 } kmAABB; 00044 00045 int kmAABBPointInBox(const kmVec3* pPoint, const kmAABB* pBox); 00046 kmAABB* kmAABBAssign(kmAABB* pOut, const kmAABB* pIn); 00047 kmAABB* kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s); 00048 00049 #ifdef __cplusplus 00050 } 00051 #endif 00052 00053 #endif