Panda3D
 All Classes Functions Variables Enumerations
bulletSoftBodyWorldInfo.cxx
1 // Filename: bulletSoftBodyWorldInfo.cxx
2 // Created by: enn0x (04Mar10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "bulletSoftBodyWorldInfo.h"
16 
17 ////////////////////////////////////////////////////////////////////
18 // Function: BulletSoftBodyWorldInfo::Constructor
19 // Access: Published
20 // Description:
21 ////////////////////////////////////////////////////////////////////
22 BulletSoftBodyWorldInfo::
23 BulletSoftBodyWorldInfo(btSoftBodyWorldInfo &info) : _info(info) {
24 
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: BulletSoftBodyWorldInfo::garbage_collect
29 // Access: Published
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 void BulletSoftBodyWorldInfo::
33 garbage_collect(int lifetime) {
34 
35  _info.m_sparsesdf.GarbageCollect(lifetime);
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: BulletSoftBodyWorldInfo::set_air_density
40 // Access: Published
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 void BulletSoftBodyWorldInfo::
44 set_air_density(PN_stdfloat density) {
45 
46  _info.air_density = (btScalar)density;
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: BulletSoftBodyWorldInfo::set_water_density
51 // Access: Published
52 // Description:
53 ////////////////////////////////////////////////////////////////////
54 void BulletSoftBodyWorldInfo::
55 set_water_density(PN_stdfloat density) {
56 
57  _info.water_density = (btScalar)density;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: BulletSoftBodyWorldInfo::set_water_offset
62 // Access: Published
63 // Description:
64 ////////////////////////////////////////////////////////////////////
65 void BulletSoftBodyWorldInfo::
66 set_water_offset(PN_stdfloat offset) {
67 
68  _info.water_offset = (btScalar)offset;
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: BulletSoftBodyWorldInfo::set_water_normal
73 // Access: Published
74 // Description:
75 ////////////////////////////////////////////////////////////////////
76 void BulletSoftBodyWorldInfo::
77 set_water_normal(const LVector3 &normal) {
78 
79  nassertv(!normal.is_nan());
80  _info.water_normal.setValue(normal.get_x(), normal.get_y(), normal.get_z());
81 }
82 
83 ////////////////////////////////////////////////////////////////////
84 // Function: BulletSoftBodyWorldInfo::set_gravity
85 // Access: Published
86 // Description:
87 ////////////////////////////////////////////////////////////////////
88 void BulletSoftBodyWorldInfo::
89 set_gravity(const LVector3 &gravity) {
90 
91  nassertv(!gravity.is_nan());
92  _info.m_gravity.setValue(gravity.get_x(), gravity.get_y(), gravity.get_z());
93 }
94 
95 ////////////////////////////////////////////////////////////////////
96 // Function: BulletSoftBodyWorldInfo::get_air_density
97 // Access: Published
98 // Description:
99 ////////////////////////////////////////////////////////////////////
100 PN_stdfloat BulletSoftBodyWorldInfo::
101 get_air_density() const {
102 
103  return (PN_stdfloat)_info.air_density;
104 }
105 
106 ////////////////////////////////////////////////////////////////////
107 // Function: BulletSoftBodyWorldInfo::get_water_density
108 // Access: Published
109 // Description:
110 ////////////////////////////////////////////////////////////////////
111 PN_stdfloat BulletSoftBodyWorldInfo::
112 get_water_density() const {
113 
114  return (PN_stdfloat)_info.water_density;
115 }
116 
117 ////////////////////////////////////////////////////////////////////
118 // Function: BulletSoftBodyWorldInfo::get_water_offset
119 // Access: Published
120 // Description:
121 ////////////////////////////////////////////////////////////////////
122 PN_stdfloat BulletSoftBodyWorldInfo::
123 get_water_offset() const {
124 
125  return (PN_stdfloat)_info.water_offset;
126 }
127 
128 ////////////////////////////////////////////////////////////////////
129 // Function: BulletSoftBodyWorldInfo::get_water_normal
130 // Access: Published
131 // Description:
132 ////////////////////////////////////////////////////////////////////
133 LVector3 BulletSoftBodyWorldInfo::
134 get_water_normal() const {
135 
136  return btVector3_to_LVector3(_info.water_normal);
137 }
138 
139 ////////////////////////////////////////////////////////////////////
140 // Function: BulletSoftBodyWorldInfo::get_gravity
141 // Access: Published
142 // Description:
143 ////////////////////////////////////////////////////////////////////
144 LVector3 BulletSoftBodyWorldInfo::
145 get_gravity() const {
146 
147  return btVector3_to_LVector3(_info.m_gravity);
148 }
149 
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
Definition: lvecBase3.h:463