Panda3D

Loading...
Searching...
No Matches
physxSphereForceFieldShape.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 physxSphereForceFieldShape.h
10 * @author enn0x
11 * @date 2009-11-15
12 */
13
14#ifndef PHYSXSPHEREFORCEFIELDSHAPE_H
15#define PHYSXSPHEREFORCEFIELDSHAPE_H
16
17#include "pandabase.h"
18#include "luse.h"
19
20#include "physxForceFieldShape.h"
21#include "physx_includes.h"
22
23 class PhysxSphereForceFieldShapeDesc;
24
25/**
26 * A spherical force field shape.
27 */
28 class EXPCL_PANDAPHYSX PhysxSphereForceFieldShape : public PhysxForceFieldShape {
29
30PUBLISHED:
31 INLINE PhysxSphereForceFieldShape();
32 INLINE ~PhysxSphereForceFieldShape();
33
34 void save_to_desc(PhysxSphereForceFieldShapeDesc &shapeDesc) const;
35
36 void set_radius(float radius);
37
38 float get_radius() const;
39
40 public:
41 INLINE NxForceFieldShape *ptr() const { return (NxForceFieldShape *)_ptr; };
42
43 void link(NxForceFieldShape *shapePtr);
44 void unlink();
45
46 private:
47 NxSphereForceFieldShape *_ptr;
48
49 public:
50 static TypeHandle get_class_type() {
51 return _type_handle;
52 }
53 static void init_type() {
54 PhysxForceFieldShape::init_type();
55 register_type(_type_handle, "PhysxSphereForceFieldShape",
56 PhysxForceFieldShape::get_class_type());
57 }
58 virtual TypeHandle get_type() const {
59 return get_class_type();
60 }
61 virtual TypeHandle force_init_type() {
62 init_type();
63 return get_class_type();
64 }
65
66 private:
67 static TypeHandle _type_handle;
68};
69
70#include "physxSphereForceFieldShape.I"
71
72#endif // PHYSXSPHEREFORCEFIELDSHAPE_H
PhysxSphereForceFieldShapeDesc
A descriptor for a sphere force field shape.
Definition physxSphereForceFieldShapeDesc.h:25
PhysxSphereForceFieldShape::get_radius
float get_radius() const
Returns the radius of the sphere.
Definition physxSphereForceFieldShape.cxx:72
PhysxSphereForceFieldShape::save_to_desc
void save_to_desc(PhysxSphereForceFieldShapeDesc &shapeDesc) const
Saves the state of the shape object to a descriptor.
Definition physxSphereForceFieldShape.cxx:52
PhysxSphereForceFieldShape::set_radius
void set_radius(float radius)
Sets the sphere radius.
Definition physxSphereForceFieldShape.cxx:62
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.
physxForceFieldShape.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
physxSphereForceFieldShape.I
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