odeQuadTreeSpace.cxx

00001 // Filename: odeQuadTreeSpace.cxx
00002 // Created by:  joswilso (27Dec06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "config_ode.h"
00016 #include "odeQuadTreeSpace.h"
00017 
00018 TypeHandle OdeQuadTreeSpace::_type_handle;
00019 
00020 typedef struct { dVector4 vec; } sdVector4;
00021 
00022 sdVector4 LVec3_to_sdVector4(const LVecBase3f& vec) {
00023   sdVector4 sdVec4;
00024 
00025   sdVec4.vec[0] = vec[0];
00026   sdVec4.vec[1] = vec[1];
00027   sdVec4.vec[2] = vec[2];
00028   sdVec4.vec[3] = 0;
00029 
00030   return sdVec4;
00031 }
00032 
00033 OdeQuadTreeSpace::
00034 OdeQuadTreeSpace(dSpaceID id) :
00035   OdeSpace(id) {
00036 }
00037 
00038 OdeQuadTreeSpace::
00039 OdeQuadTreeSpace(const LPoint3f &center,
00040                  const LVecBase3f &extents,
00041                  const int depth) :
00042   OdeSpace(dQuadTreeSpaceCreate(0,
00043                                 LVec3_to_sdVector4(center).vec,
00044                                 LVec3_to_sdVector4(extents).vec,
00045                                 depth)) {
00046 }
00047 
00048 OdeQuadTreeSpace::
00049 OdeQuadTreeSpace(OdeSpace &space,
00050                  const LPoint3f &center,
00051                  const LVecBase3f &extents,
00052                  const int depth) :
00053   OdeSpace(dQuadTreeSpaceCreate(space.get_id(),
00054                                 LVec3_to_sdVector4(center).vec,
00055                                 LVec3_to_sdVector4(extents).vec,
00056                                 depth)) {
00057 }
00058 
00059 OdeQuadTreeSpace::
00060 ~OdeQuadTreeSpace() {
00061 }
00062