Panda3D
 All Classes Functions Variables Enumerations
bulletSphereShape.cxx
1 // Filename: bulletSphereShape.cxx
2 // Created by: enn0x (23Jan10)
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 "bulletSphereShape.h"
16 
17 TypeHandle BulletSphereShape::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function: BulletSphereShape::Constructor
21 // Access: Published
22 // Description:
23 ////////////////////////////////////////////////////////////////////
24 BulletSphereShape::
25 BulletSphereShape(PN_stdfloat radius) {
26 
27  _shape = new btSphereShape(radius);
28  _shape->setUserPointer(this);
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: BulletSphereShape::ptr
33 // Access: Public
34 // Description:
35 ////////////////////////////////////////////////////////////////////
36 btCollisionShape *BulletSphereShape::
37 ptr() const {
38 
39  return _shape;
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: BulletSphereShape::make_from_solid
44 // Access: Public
45 // Description:
46 ////////////////////////////////////////////////////////////////////
47 BulletSphereShape *BulletSphereShape::
48 make_from_solid(const CollisionSphere *solid) {
49 
50  return new BulletSphereShape(solid->get_radius());
51 }
52 
A spherical collision volume or object.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85