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