Panda3D
physxForceFieldShapeGroupDesc.cxx
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 physxForceFieldShapeGroupDesc.cxx
10  * @author enn0x
11  * @date 2009-11-11
12  */
13 
15 
16 /**
17  * Adds a shape to the list of force field shapes composing this shape group.
18  */
21 
22  _desc.shapes.push_back(desc.ptr());
23 }
24 
25 /**
26  * Sets the optional debug name for the force field shape group.
27  */
29 set_name(const char *name) {
30 
31  _name = name ? name : "";
32  _desc.name = _name.c_str();
33 }
34 
35 /**
36  * Returns the optional debug name for this force field shape group.
37  */
39 get_name() const {
40 
41  return _desc.name;
42 }
43 
44 /**
45  * Raise or lower individual force field shape group flags.
46  */
48 set_flag(const PhysxForceFieldShapeGroupFlag flag, bool value) {
49 
50  if (value == true) {
51  _desc.flags |= flag;
52  }
53  else {
54  _desc.flags &= ~(flag);
55  }
56 }
57 
58 /**
59  * Returns the specified force field shape group flag.
60  */
62 get_flag(const PhysxForceFieldShapeGroupFlag flag) const {
63 
64  return (_desc.flags & flag) ? true : false;
65 }
Abstract base class for descriptors for force field shapes descriptors.
const char * get_name() const
Returns the optional debug name for this force field shape group.
void add_shape(PhysxForceFieldShapeDesc &desc)
Adds a shape to the list of force field shapes composing this shape group.
void set_name(const char *name)
Sets the optional debug name for the force field shape group.
bool get_flag(PhysxForceFieldShapeGroupFlag flag) const
Returns the specified force field shape group flag.
void set_flag(PhysxForceFieldShapeGroupFlag flag, bool value)
Raise or lower individual force field shape group flags.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.