Panda3D
physxHeightFieldShape.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxHeightFieldShape.h
10  * @author enn0x
11  * @date 2009-10-15
12  */
13 
14 #ifndef PHYSXHEIGHTFIELDSHAPE_H
15 #define PHYSXHEIGHTFIELDSHAPE_H
16 
17 #include "pandabase.h"
18 
19 #include "physxShape.h"
20 #include "physx_includes.h"
21 
23 
24 /**
25  * This class is a shape instance of a height field object of type
26  * PhysxHeightField. Each shape is owned by an actor that it is attached to.
27  *
28  * An instance can be created by calling the createShape() method of the
29  * PhysxActor object that should own it, with a PhysxHeightFieldShapeDesc
30  * object as the parameter, or by adding the shape descriptor into the
31  * PhysxActorDesc class before creating the actor.
32  *
33  * The shape is deleted by calling release() on the shape itself.
34  */
35 class EXPCL_PANDAPHYSX PhysxHeightFieldShape : public PhysxShape {
36 
37 PUBLISHED:
38  INLINE PhysxHeightFieldShape();
39  INLINE ~PhysxHeightFieldShape();
40 
41  void save_to_desc(PhysxHeightFieldShapeDesc &shapeDesc) const;
42 
43 public:
44  INLINE NxShape *ptr() const { return (NxShape *)_ptr; };
45 
46  void link(NxShape *shapePtr);
47  void unlink();
48 
49 private:
50  NxHeightFieldShape *_ptr;
51 
52 public:
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  PhysxShape::init_type();
58  register_type(_type_handle, "PhysxHeightFieldShape",
59  PhysxShape::get_class_type());
60  }
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {
65  init_type();
66  return get_class_type();
67  }
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "physxHeightFieldShape.I"
74 
75 #endif // PHYSXHEIGHTFIELDSHAPE_H
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Abstract base class for shapes.
Definition: physxShape.h:39
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:81