Panda3D

physxForceField.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 physxForceField.h
10 * @author enn0x
11 * @date 2009-11-06
12 */
13
14 #ifndef PHYSXFORCEFIELD_H
15 #define PHYSXFORCEFIELD_H
16
17 #include "pandabase.h"
18 #include "luse.h"
19
20 #include "physxObject.h"
21 #include "physx_includes.h"
22
23 class PhysxScene;
24 class PhysxForceFieldDesc;
25 class PhysxForceFieldShapeGroup;
26
27 /**
28 * A force field effector. Instances of this object automate the application
29 * of forces onto rigid bodies, fluid, soft bodies and cloth. Force fields
30 * allow you to implement for example gusts of wind, dust devils, vacuum
31 * cleaners or anti-gravity zones.
32 */
33 class EXPCL_PANDAPHYSX PhysxForceField : public PhysxObject {
34
35 PUBLISHED:
36 INLINE PhysxForceField();
37 INLINE ~PhysxForceField();
38
39 // void load_from_desc(const PhysxForceFieldDesc &materialDesc); void
40 // save_to_desc(PhysxForceFieldDesc &materialDesc) const;
41
42 void set_name(const char *name);
43
44 const char *get_name() const;
45 PhysxScene *get_scene() const;
46 PhysxForceFieldShapeGroup *get_include_shape_group() const;
47
48 unsigned int get_num_shape_groups() const;
49 PhysxForceFieldShapeGroup *get_shape_group(unsigned int idx) const;
50 MAKE_SEQ(get_shape_groups, get_num_shape_groups, get_shape_group);
51
52 PUBLISHED:
53 void release();
54
55 INLINE void ls() const;
56 INLINE void ls(std::ostream &out, int indent_level=0) const;
57
58 public:
59 INLINE NxForceField *ptr() const { return _ptr; };
60
61 void link(NxForceField *ptr);
62 void unlink();
63
64 private:
65 NxForceField *_ptr;
66 std::string _name;
67
68 public:
69 static TypeHandle get_class_type() {
70 return _type_handle;
71 }
72 static void init_type() {
73 PhysxObject::init_type();
74 register_type(_type_handle, "PhysxForceField",
75 PhysxObject::get_class_type());
76 }
77 virtual TypeHandle get_type() const {
78 return get_class_type();
79 }
80 virtual TypeHandle force_init_type() {
81 init_type();
82 return get_class_type();
83 }
84
85 private:
86 static TypeHandle _type_handle;
87 };
88
89 #include "physxForceField.I"
90
91 #endif // PHYSXFORCEFIELD_H
PhysxForceFieldDesc
Descriptor class for force fields.
Definition: physxForceFieldDesc.h:30
PhysxForceFieldShapeGroup
Definition: physxForceFieldShapeGroup.h:33
PhysxForceField
A force field effector.
Definition: physxForceField.h:33
PhysxObject
Definition: physxObject.h:28
PhysxScene
A scene is a collection of bodies, constraints, and effectors which can interact.
Definition: physxScene.h:69
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
luse.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxForceField.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physx_includes.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
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