Panda3D

physxForceFieldShapeGroupDesc.cxx

00001 // Filename: physxForceFieldShapeGroupDesc.cxx
00002 // Created by:  enn0x (11Nov09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "physxForceFieldShapeGroupDesc.h"
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: PhysxForceFieldShapeGroupDesc::add_shape
00019 //       Access: Published
00020 //  Description: Adds a shape to the list of force field shapes
00021 //               composing this shape group.
00022 ////////////////////////////////////////////////////////////////////
00023 void PhysxForceFieldShapeGroupDesc::
00024 add_shape(PhysxForceFieldShapeDesc &desc) {
00025 
00026   _desc.shapes.push_back(desc.ptr());
00027 }
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: PhysxForceFieldShapeGroupDesc::set_name
00031 //       Access: Published
00032 //  Description: Sets the optional debug name for the force field
00033 //               shape group.
00034 ////////////////////////////////////////////////////////////////////
00035 void PhysxForceFieldShapeGroupDesc::
00036 set_name(const char *name) {
00037 
00038   _name = name ? name : "";
00039   _desc.name = _name.c_str();
00040 }
00041 
00042 ////////////////////////////////////////////////////////////////////
00043 //     Function: PhysxForceFieldShapeGroupDesc::get_name
00044 //       Access: Published
00045 //  Description: Returns the optional debug name for this force
00046 //               field shape group.
00047 ////////////////////////////////////////////////////////////////////
00048 const char *PhysxForceFieldShapeGroupDesc::
00049 get_name() const {
00050 
00051   return _desc.name;
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: PhysxForceFieldShapeGroupDesc::set_flag
00056 //       Access: Published
00057 //  Description: Raise or lower individual force field shape group
00058 //               flags.
00059 ////////////////////////////////////////////////////////////////////
00060 void PhysxForceFieldShapeGroupDesc::
00061 set_flag(const PhysxForceFieldShapeGroupFlag flag, bool value) {
00062 
00063   if (value == true) {
00064     _desc.flags |= flag;
00065   }
00066   else {
00067     _desc.flags &= ~(flag);
00068   }
00069 }
00070 
00071 ////////////////////////////////////////////////////////////////////
00072 //     Function: PhysxForceFieldShapeGroupDesc::get_flag
00073 //       Access: Published
00074 //  Description: Returns the specified force field shape group
00075 //               flag.
00076 ////////////////////////////////////////////////////////////////////
00077 bool PhysxForceFieldShapeGroupDesc::
00078 get_flag(const PhysxForceFieldShapeGroupFlag flag) const {
00079 
00080   return (_desc.flags & flag) ? true : false;
00081 }
00082 
 All Classes Functions Variables Enumerations