Panda3D
 All Classes Functions Variables Enumerations
bulletSoftBodyWorldInfo.cxx
00001 // Filename: bulletSoftBodyWorldInfo.cxx
00002 // Created by:  enn0x (04Mar10)
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 "bulletSoftBodyWorldInfo.h"
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: BulletSoftBodyWorldInfo::Constructor
00019 //       Access: Published
00020 //  Description:
00021 ////////////////////////////////////////////////////////////////////
00022 BulletSoftBodyWorldInfo::
00023 BulletSoftBodyWorldInfo(btSoftBodyWorldInfo &info) : _info(info) {
00024 
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: BulletSoftBodyWorldInfo::garbage_collect
00029 //       Access: Published
00030 //  Description:
00031 ////////////////////////////////////////////////////////////////////
00032 void BulletSoftBodyWorldInfo::
00033 garbage_collect(int lifetime) {
00034 
00035   _info.m_sparsesdf.GarbageCollect(lifetime);
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: BulletSoftBodyWorldInfo::set_air_density
00040 //       Access: Published
00041 //  Description:
00042 ////////////////////////////////////////////////////////////////////
00043 void BulletSoftBodyWorldInfo::
00044 set_air_density(PN_stdfloat density) {
00045 
00046   _info.air_density = (btScalar)density;
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: BulletSoftBodyWorldInfo::set_water_density
00051 //       Access: Published
00052 //  Description:
00053 ////////////////////////////////////////////////////////////////////
00054 void BulletSoftBodyWorldInfo::
00055 set_water_density(PN_stdfloat density) {
00056 
00057   _info.water_density = (btScalar)density;
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: BulletSoftBodyWorldInfo::set_water_offset
00062 //       Access: Published
00063 //  Description:
00064 ////////////////////////////////////////////////////////////////////
00065 void BulletSoftBodyWorldInfo::
00066 set_water_offset(PN_stdfloat offset) {
00067 
00068   _info.water_offset = (btScalar)offset;
00069 }
00070 
00071 ////////////////////////////////////////////////////////////////////
00072 //     Function: BulletSoftBodyWorldInfo::set_water_normal
00073 //       Access: Published
00074 //  Description:
00075 ////////////////////////////////////////////////////////////////////
00076 void BulletSoftBodyWorldInfo::
00077 set_water_normal(const LVector3 &normal) {
00078 
00079   nassertv(!normal.is_nan());
00080   _info.water_normal = LVecBase3_to_btVector3(normal);
00081 }
00082 
00083 ////////////////////////////////////////////////////////////////////
00084 //     Function: BulletSoftBodyWorldInfo::set_gravity
00085 //       Access: Published
00086 //  Description:
00087 ////////////////////////////////////////////////////////////////////
00088 void BulletSoftBodyWorldInfo::
00089 set_gravity(const LVector3 &gravity) {
00090 
00091   nassertv(!gravity.is_nan());
00092   _info.m_gravity = LVecBase3_to_btVector3(gravity);
00093 }
00094 
00095 ////////////////////////////////////////////////////////////////////
00096 //     Function: BulletSoftBodyWorldInfo::get_air_density
00097 //       Access: Published
00098 //  Description:
00099 ////////////////////////////////////////////////////////////////////
00100 PN_stdfloat BulletSoftBodyWorldInfo::
00101 get_air_density() const {
00102 
00103   return (PN_stdfloat)_info.air_density;
00104 }
00105 
00106 ////////////////////////////////////////////////////////////////////
00107 //     Function: BulletSoftBodyWorldInfo::get_water_density
00108 //       Access: Published
00109 //  Description:
00110 ////////////////////////////////////////////////////////////////////
00111 PN_stdfloat BulletSoftBodyWorldInfo::
00112 get_water_density() const {
00113 
00114   return (PN_stdfloat)_info.water_density;
00115 }
00116 
00117 ////////////////////////////////////////////////////////////////////
00118 //     Function: BulletSoftBodyWorldInfo::get_water_offset
00119 //       Access: Published
00120 //  Description:
00121 ////////////////////////////////////////////////////////////////////
00122 PN_stdfloat BulletSoftBodyWorldInfo::
00123 get_water_offset() const {
00124 
00125   return (PN_stdfloat)_info.water_offset;
00126 }
00127 
00128 ////////////////////////////////////////////////////////////////////
00129 //     Function: BulletSoftBodyWorldInfo::get_water_normal
00130 //       Access: Published
00131 //  Description:
00132 ////////////////////////////////////////////////////////////////////
00133 LVector3 BulletSoftBodyWorldInfo::
00134 get_water_normal() const {
00135 
00136   return btVector3_to_LVector3(_info.water_normal);
00137 }
00138 
00139 ////////////////////////////////////////////////////////////////////
00140 //     Function: BulletSoftBodyWorldInfo::get_gravity
00141 //       Access: Published
00142 //  Description:
00143 ////////////////////////////////////////////////////////////////////
00144 LVector3 BulletSoftBodyWorldInfo::
00145 get_gravity() const {
00146 
00147   return btVector3_to_LVector3(_info.m_gravity);
00148 }
00149 
 All Classes Functions Variables Enumerations