Panda3D
 All Classes Functions Variables Enumerations
physxSphereShape.h
1 // Filename: physxSphereShape.h
2 // Created by: enn0x (16Sep09)
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 #ifndef PHYSXSPHERESHAPE_H
16 #define PHYSXSPHERESHAPE_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 
21 #include "physxShape.h"
22 #include "physx_includes.h"
23 
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : PhysxSphereShape
28 // Description : A sphere shaped collision detection primitive.
29 // Each shape is owned by an actor that it is attached
30 // to.
31 //
32 // An instance can be created by calling the
33 // createShape() method of the PhysxActor object that
34 // should own it, with a PhysxSphereShapeDesc object
35 // as the parameter, or by adding the shape descriptor
36 // into the PhysxActorDesc class before creating the
37 // actor.
38 //
39 // The shape is deleted by calling release() on the
40 // shape itself.
41 ////////////////////////////////////////////////////////////////////
42 class EXPCL_PANDAPHYSX PhysxSphereShape : public PhysxShape {
43 
44 PUBLISHED:
45  INLINE PhysxSphereShape();
46  INLINE ~PhysxSphereShape();
47 
48  void save_to_desc(PhysxSphereShapeDesc &shapeDesc) const;
49 
50  void set_radius(float radius);
51 
52  float get_radius() const;
53 
54 ////////////////////////////////////////////////////////////////////
55 public:
56  INLINE NxShape *ptr() const { return (NxShape *)_ptr; };
57 
58  void link(NxShape *shapePtr);
59  void unlink();
60 
61 private:
62  NxSphereShape *_ptr;
63 
64 ////////////////////////////////////////////////////////////////////
65 public:
66  static TypeHandle get_class_type() {
67  return _type_handle;
68  }
69  static void init_type() {
70  PhysxShape::init_type();
71  register_type(_type_handle, "PhysxSphereShape",
72  PhysxShape::get_class_type());
73  }
74  virtual TypeHandle get_type() const {
75  return get_class_type();
76  }
77  virtual TypeHandle force_init_type() {
78  init_type();
79  return get_class_type();
80  }
81 
82 private:
83  static TypeHandle _type_handle;
84 };
85 
86 #include "physxSphereShape.I"
87 
88 #endif // PHYSXSPHERESHAPE_H
Descriptor class for PhysxSphereShape.
Abstract base class for shapes.
Definition: physxShape.h:41
A sphere shaped collision detection primitive.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85