Biomechanical Joint Model
 Author: Anderson Maciel

obb.H

Go to the documentation of this file.
00001 
00002 /*************************************************************************\
00003 
00004   Copyright 1995 The University of North Carolina at Chapel Hill.
00005   All Rights Reserved.
00006 
00007   Permission to use, copy, modify and distribute this software and its
00008   documentation for educational, research and non-profit purposes, without
00009   fee, and without a written agreement is hereby granted, provided that the
00010   above copyright notice and the following three paragraphs appear in all
00011   copies.
00012 
00013   IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE
00014   LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
00015   CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE
00016   USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY
00017   OF NORTH CAROLINA HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
00018   DAMAGES.
00019 
00020 
00021   Permission to use, copy, modify and distribute this software and its
00022   documentation for educational, research and non-profit purposes, without
00023   fee, and without a written agreement is hereby granted, provided that the
00024   above copyright notice and the following three paragraphs appear in all
00025   copies.
00026 
00027   THE UNIVERSITY OF NORTH CAROLINA SPECIFICALLY DISCLAIM ANY
00028   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00029   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
00030   PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
00031   NORTH CAROLINA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
00032   UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
00033 
00034   The authors may be contacted via:
00035 
00036   US Mail:             S. Gottschalk
00037                        Department of Computer Science
00038                        Sitterson Hall, CB #3175
00039                        University of N. Carolina
00040                        Chapel Hill, NC 27599-3175
00041 
00042   Phone:               (919)962-1749
00043 
00044   EMail:              {gottscha}@cs.unc.edu
00045 
00046 
00047 \**************************************************************************/
00048 
00049 #ifndef OBB_H
00050 #define OBB_H
00051 
00052 struct tri
00053 {
00054   int id;
00055   double p1[3], p2[3], p3[3];
00056 };
00057 
00058 
00059 class box
00060 {
00061 public:
00062 
00063   // placement in parent's space
00064   // box to parent space: x_m = pR*x_b + pT
00065   // parent to box space: x_b = pR.T()*(x_m - pT)
00066   double pR[3][3];
00067   double pT[3];
00068   
00069   // dimensions
00070   double d[3];        // this is "radius", that is, 
00071                       // half the measure of a side length
00072 
00073   box *P;  // points to but does not "own".  
00074   box *N;
00075 
00076   tri *trp;
00077 
00078   int leaf() { return (!P && !N); } 
00079   double size() { return d[0]; } 
00080 
00081   int split_recurse(int *t, int n);
00082   int split_recurse(int *t);               // specialized for leaf nodes
00083 };
00084 
00085 const int RAPID_BUILD_STATE_CONST = 0;     // "empty" state, after constructor
00086 const int RAPID_BUILD_STATE_BEGIN = 1;     // after BeginModel()
00087 const int RAPID_BUILD_STATE_ADDTRI = 2;    // after AddTri()
00088 const int RAPID_BUILD_STATE_PROCESSED = 3; // after EndModel()
00089 
00090 #endif

Generated on Thu Dec 1 10:13:39 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5