Panda3D
 All Classes Functions Variables Enumerations
bulletSoftBodyConfig.cxx
00001 // Filename: bulletSoftBodyConfig.cxx
00002 // Created by:  enn0x (12Apr10)
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 "bulletSoftBodyConfig.h"
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: BulletSoftBodyConfig::Constructor
00019 //       Access: Public
00020 //  Description:
00021 ////////////////////////////////////////////////////////////////////
00022 BulletSoftBodyConfig::
00023 BulletSoftBodyConfig(btSoftBody::Config &cfg) : _cfg(cfg) {
00024 
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: BulletSoftBodyConfig::clear_collisions
00029 //       Access: Published
00030 //  Description:
00031 ////////////////////////////////////////////////////////////////////
00032 void BulletSoftBodyConfig::
00033 clear_all_collision_flags() {
00034 
00035   _cfg.collisions = 0;
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: BulletSoftBodyConfig::set_collisions
00040 //       Access: Published
00041 //  Description:
00042 ////////////////////////////////////////////////////////////////////
00043 void BulletSoftBodyConfig::
00044 set_collision_flag(CollisionFlag flag, bool value) {
00045 
00046   if (value == true) {
00047     _cfg.collisions |= flag;
00048   }
00049   else {
00050     _cfg.collisions &= ~(flag);
00051   }
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: BulletSoftBodyConfig::get_collisions
00056 //       Access: Published
00057 //  Description:
00058 ////////////////////////////////////////////////////////////////////
00059 bool BulletSoftBodyConfig::
00060 get_collision_flag(CollisionFlag flag) const {
00061 
00062   return (_cfg.collisions & flag) ? true : false;
00063 }
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //     Function: BulletSoftBodyConfig::set_aero_model
00067 //       Access: Published
00068 //  Description:
00069 ////////////////////////////////////////////////////////////////////
00070 void BulletSoftBodyConfig::
00071 set_aero_model(AeroModel value) {
00072 
00073   _cfg.aeromodel = (btSoftBody::eAeroModel::_)value;
00074 }
00075 
00076 ////////////////////////////////////////////////////////////////////
00077 //     Function: BulletSoftBodyConfig::get_aero_model
00078 //       Access: Published
00079 //  Description:
00080 ////////////////////////////////////////////////////////////////////
00081 BulletSoftBodyConfig::AeroModel BulletSoftBodyConfig::
00082 get_aero_model() const {
00083 
00084   return (AeroModel)_cfg.aeromodel;
00085 }
00086 
 All Classes Functions Variables Enumerations