Panda3D
 All Classes Functions Variables Enumerations
odeQuadTreeSpace.cxx
1 // Filename: odeQuadTreeSpace.cxx
2 // Created by: joswilso (27Dec06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_ode.h"
16 #include "odeQuadTreeSpace.h"
17 
18 TypeHandle OdeQuadTreeSpace::_type_handle;
19 
20 typedef struct { dVector4 vec; } sdVector4;
21 
22 sdVector4 LVec3_to_sdVector4(const LVecBase3f& vec) {
23  sdVector4 sdVec4;
24 
25  sdVec4.vec[0] = vec[0];
26  sdVec4.vec[1] = vec[1];
27  sdVec4.vec[2] = vec[2];
28  sdVec4.vec[3] = 0;
29 
30  return sdVec4;
31 }
32 
33 OdeQuadTreeSpace::
34 OdeQuadTreeSpace(dSpaceID id) :
35  OdeSpace(id) {
36 }
37 
38 OdeQuadTreeSpace::
39 OdeQuadTreeSpace(const LPoint3f &center,
40  const LVecBase3f &extents,
41  const int depth) :
42  OdeSpace(dQuadTreeSpaceCreate(0,
43  LVec3_to_sdVector4(center).vec,
44  LVec3_to_sdVector4(extents).vec,
45  depth)) {
46 }
47 
48 OdeQuadTreeSpace::
49 OdeQuadTreeSpace(OdeSpace &space,
50  const LPoint3f &center,
51  const LVecBase3f &extents,
52  const int depth) :
53  OdeSpace(dQuadTreeSpaceCreate(space.get_id(),
54  LVec3_to_sdVector4(center).vec,
55  LVec3_to_sdVector4(extents).vec,
56  depth)) {
57 }
58 
59 OdeQuadTreeSpace::
60 ~OdeQuadTreeSpace() {
61 }
62 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85