Panda3D
Loading...
Searching...
No Matches
physxCapsuleForceFieldShape.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 physxCapsuleForceFieldShape.h
10 * @author enn0x
11 * @date 2009-11-15
12 */
13
14#ifndef PHYSXCAPSULEFORCEFIELDSHAPE_H
15#define PHYSXCAPSULEFORCEFIELDSHAPE_H
16
17#include "pandabase.h"
18#include "luse.h"
19
21#include "physx_includes.h"
22
24
25/**
26 * A capsule shaped region used to define a force field.
27 */
28class EXPCL_PANDAPHYSX PhysxCapsuleForceFieldShape : public PhysxForceFieldShape {
29
30PUBLISHED:
31 INLINE PhysxCapsuleForceFieldShape();
32 INLINE ~PhysxCapsuleForceFieldShape();
33
34 void save_to_desc(PhysxCapsuleForceFieldShapeDesc &shapeDesc) const;
35
36 void set_radius(float radius);
37 void set_height(float height);
38
39 float get_radius() const;
40 float get_height() const;
41
42public:
43 INLINE NxForceFieldShape *ptr() const { return (NxForceFieldShape *)_ptr; };
44
45 void link(NxForceFieldShape *shapePtr);
46 void unlink();
47
48private:
49 NxCapsuleForceFieldShape *_ptr;
50
51public:
52 static TypeHandle get_class_type() {
53 return _type_handle;
54 }
55 static void init_type() {
56 PhysxForceFieldShape::init_type();
57 register_type(_type_handle, "PhysxCapsuleForceFieldShape",
58 PhysxForceFieldShape::get_class_type());
59 }
60 virtual TypeHandle get_type() const {
61 return get_class_type();
62 }
63 virtual TypeHandle force_init_type() {
64 init_type();
65 return get_class_type();
66 }
67
68private:
69 static TypeHandle _type_handle;
70};
71
73
74#endif // PHYSXCAPSULEFORCEFIELDSHAPE_H
Descriptor for a capsule force field shape.
void set_height(float height)
Alters the height of the capsule.
float get_radius() const
Retrieves the radius of the capsule.
void set_radius(float radius)
Alters the radius of the capsule.
void save_to_desc(PhysxCapsuleForceFieldShapeDesc &shapeDesc) const
Saves the state of the shape object to a descriptor.
float get_height() const
Retrieves the height of the capsule.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...