Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

aabb3.cpp

Go to the documentation of this file.
00001 /*
00002     Sheep - A Rigid Body Dynamics Engine
00003     Copyright (C) 2001-2004 Francois Beaune
00004     Contact: http://toxicengine.sourceforge.net/
00005 
00006     This file is part of Sheep.
00007 
00008     Sheep is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     Sheep is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with Sheep; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 */
00022 
00023 #include "aabb3.h"  // include first
00024 #include "bs.h"
00025 #include "matrix4.h"
00026 
00027 #include <cassert>
00028 
00029 using namespace sheep;
00030 
00031 void AABB3::Include(const BS &bs) {
00032     //!\todo Implement.
00033     assert(!"Not implemented yet.");
00034 }
00035 
00036 AABB3 AABB3::Transform(const Matrix4 &m) const {
00037     const Point3 v0(m_min.m_x, m_min.m_y, m_min.m_z);
00038     const Point3 v1(m_min.m_x, m_min.m_y, m_max.m_z);
00039     const Point3 v2(m_min.m_x, m_max.m_y, m_min.m_z);
00040     const Point3 v3(m_min.m_x, m_max.m_y, m_max.m_z);
00041     const Point3 v4(m_max.m_x, m_min.m_y, m_min.m_z);
00042     const Point3 v5(m_max.m_x, m_min.m_y, m_max.m_z);
00043     const Point3 v6(m_max.m_x, m_max.m_y, m_min.m_z);
00044     const Point3 v7(m_max.m_x, m_max.m_y, m_max.m_z);
00045 
00046     AABB3 aabb;
00047 
00048     aabb.Include(m * v0);
00049     aabb.Include(m * v1);
00050     aabb.Include(m * v2);
00051     aabb.Include(m * v3);
00052     aabb.Include(m * v4);
00053     aabb.Include(m * v5);
00054     aabb.Include(m * v6);
00055     aabb.Include(m * v7);
00056 
00057     return aabb;
00058 }

Generated on Tue May 11 01:31:49 2004 for toxic by doxygen 1.3.6