Panda3D
 All Classes Functions Variables Enumerations
bulletMultiSphereShape.I
1 // Filename: bulletMultiSphereShape.I
2 // Created by: enn0x (04Jan12)
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 ////////////////////////////////////////////////////////////////////
16 // Function: BulletMultiSphereShape::Destructor
17 // Access: Published
18 // Description:
19 ////////////////////////////////////////////////////////////////////
20 INLINE BulletMultiSphereShape::
21 ~BulletMultiSphereShape() {
22 
23  delete _shape;
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: BulletMultiSphereShape::Copy Constructor
28 // Access: Published
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 INLINE BulletMultiSphereShape::
32 BulletMultiSphereShape(const BulletMultiSphereShape &copy) :
33  _shape(copy._shape) {
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: BulletMultiSphereShape::Copy Assignment Operator
38 // Access: Published
39 // Description:
40 ////////////////////////////////////////////////////////////////////
41 INLINE void BulletMultiSphereShape::
42 operator = (const BulletMultiSphereShape &copy) {
43  _shape = copy._shape;
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: BulletMultiSphereShape::get_sphere_count
48 // Access: Published
49 // Description:
50 ////////////////////////////////////////////////////////////////////
51 INLINE int BulletMultiSphereShape::
52 get_sphere_count() const {
53 
54  return _shape->getSphereCount();
55 }
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: BulletMultiSphereShape::get_sphere_pos
59 // Access: Published
60 // Description:
61 ////////////////////////////////////////////////////////////////////
62 INLINE LPoint3 BulletMultiSphereShape::
63 get_sphere_pos(int index) const {
64 
65  nassertr(index >=0 && index <_shape->getSphereCount(), LPoint3::zero());
66  return btVector3_to_LPoint3(_shape->getSpherePosition(index));
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: BulletMultiSphereShape::get_sphere_radius
71 // Access: Published
72 // Description:
73 ////////////////////////////////////////////////////////////////////
74 INLINE PN_stdfloat BulletMultiSphereShape::
75 get_sphere_radius(int index) const {
76 
77  nassertr(index >=0 && index <_shape->getSphereCount(), 0.0);
78  return (PN_stdfloat)_shape->getSphereRadius(index);
79 }
80 
static const LPoint3f & zero()
Returns a zero-length point.
Definition: lpoint3.h:258
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99