• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

step/stepcore

  • sources
  • kde-4.12
  • kdeedu
  • step
  • stepcore
softbody.cc
Go to the documentation of this file.
1 /* This file is part of StepCore library.
2  Copyright (C) 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com>
3 
4  StepCore library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  StepCore library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with StepCore; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #include "softbody.h"
20 #include "types.h"
21 #include <algorithm>
22 #include <cstdlib>
23 #include <QtGlobal>
24 
25 // XXX
26 #include <QStringList>
27 
28 namespace StepCore
29 {
30 
31 STEPCORE_META_OBJECT(SoftBodyParticle, QT_TRANSLATE_NOOP("ObjectClass", "SoftBodyParticle"), QT_TR_NOOP("SoftBody particle"), 0, STEPCORE_SUPER_CLASS(Particle),)
32 STEPCORE_META_OBJECT(SoftBodySpring, QT_TRANSLATE_NOOP("ObjectClass", "SoftBodySpring"), QT_TR_NOOP("SoftBody spring"), 0, STEPCORE_SUPER_CLASS(Spring),)
33 STEPCORE_META_OBJECT(SoftBody, QT_TRANSLATE_NOOP("ObjectClass", "SoftBody"), QT_TR_NOOP("Deformable SoftBody"), 0, STEPCORE_SUPER_CLASS(ItemGroup),
34  STEPCORE_PROPERTY_RW(bool, showInternalItems, QT_TRANSLATE_NOOP("PropertyName", "showInternalItems"), STEPCORE_UNITS_NULL, QT_TR_NOOP("Show internal items"),
35  showInternalItems, setShowInternalItems)
36  STEPCORE_PROPERTY_RW_D(StepCore::Vector2d, position, QT_TRANSLATE_NOOP("PropertyName", "position"), QT_TRANSLATE_NOOP("Units", "m"), QT_TR_NOOP("Position of the center of mass"), position, setPosition)
37 
38  STEPCORE_PROPERTY_RW_D(StepCore::Vector2d, velocity, QT_TRANSLATE_NOOP("PropertyName", "velocity"), QT_TRANSLATE_NOOP("Units", "m/s"), QT_TR_NOOP("Velocity of the center of mass"), velocity, setVelocity)
39  STEPCORE_PROPERTY_RW_D(double, angularVelocity, QT_TRANSLATE_NOOP("PropertyName", "angularVelocity"), QT_TRANSLATE_NOOP("Units", "rad/s"), QT_TR_NOOP("Angular velocity of the body"), angularVelocity, setAngularVelocity)
40  STEPCORE_PROPERTY_RW_D(double, angularMomentum, QT_TRANSLATE_NOOP("PropertyName", "angularMomentum"), STEPCORE_FROM_UTF8(QT_TRANSLATE_NOOP("Units", "kg m²/s")),
41  QT_TR_NOOP("Angular momentum of the body"), angularMomentum, setAngularMomentum)
42 
43  STEPCORE_PROPERTY_R_D(StepCore::Vector2d, acceleration, QT_TRANSLATE_NOOP("PropertyName", "acceleration"), STEPCORE_FROM_UTF8(QT_TRANSLATE_NOOP("Units", "m/s²")),
44  QT_TR_NOOP("Acceleration of the center of mass"), acceleration)
45  STEPCORE_PROPERTY_R_D(double, angularAcceleration, QT_TRANSLATE_NOOP("PropertyName", "angularAcceleration"), STEPCORE_FROM_UTF8(QT_TRANSLATE_NOOP("Units", "rad/s²")),
46  QT_TR_NOOP("Angular acceleration of the body"), angularAcceleration)
47 
48  STEPCORE_PROPERTY_R_D(StepCore::Vector2d, force, QT_TRANSLATE_NOOP("PropertyName", "force"), QT_TRANSLATE_NOOP("Units", "N"), QT_TR_NOOP("Force that acts upon the body"), force)
49  STEPCORE_PROPERTY_R_D(double, torque, QT_TRANSLATE_NOOP("PropertyName", "torque"), QT_TRANSLATE_NOOP("Units", "N m"), QT_TR_NOOP("Torque that acts upon the body"), torque)
50  STEPCORE_PROPERTY_R_D(double, mass, QT_TRANSLATE_NOOP("PropertyName", "mass"), QT_TRANSLATE_NOOP("Units", "kg"), QT_TR_NOOP("Total mass of the body"), mass)
51  STEPCORE_PROPERTY_R_D(double, inertia, QT_TRANSLATE_NOOP("PropertyName", "inertia"), STEPCORE_FROM_UTF8(QT_TRANSLATE_NOOP("Units", "kg m²")),
52  QT_TR_NOOP("Inertia \"tensor\" of the body"), inertia)
53  STEPCORE_PROPERTY_RW(QString, borderParticleNames, QT_TRANSLATE_NOOP("PropertyName", "borderParticleNames"), STEPCORE_UNITS_NULL,
54  QT_TR_NOOP("Border particle names (temporal property)"), borderParticleNames, setBorderParticleNames)
55  )
56 
57 
58 ItemList SoftBody::createSoftBodyItems(const Vector2d& position, const Vector2d& size, const Vector2i& split,
59  double bodyMass, double youngModulus, double bodyDamping)
60 {
61  ItemList items;
62  _borderParticles.clear();
63 
64  if((split[0] < 1 || split[1] < 1) || (split[0] == 1 && split[1] == 1)) {
65  return items;
66  }
67 
68  Vector2d vel = Vector2d::Zero(); //to be changed
69  Vector2d pos;
70 
71  double mass = bodyMass/(split[0]*split[1]);
72  double stiffnes;
73  double damping;
74  double h0;
75  double h1;
76  double h;
77 
78  if(split[0] == 1) {
79  _borderParticles.resize(split[1]);
80  stiffnes = youngModulus/(split[1]-1);
81  damping = bodyDamping/(split[1]-1);
82  h1 = size[1]/(split[1]-1); h0 = 0;
83  } else if(split[1] == 1) {
84  _borderParticles.resize(split[0]);
85  stiffnes = youngModulus/(split[0]-1);
86  damping = bodyDamping/(split[0]-1);
87  h0 = size[0]/(split[0]-1); h1 = 0;
88  } else {
89  _borderParticles.resize(2*split[0] + 2*split[1] - 4);
90  stiffnes = youngModulus*(size[0]/size[1])*(split[0]-1)/(2*split[1]-1);
91  damping = bodyDamping* (size[0]/size[1])*(split[0]-1)/(2*split[1]-1);
92  h0 = size[0]/(split[0]-1);
93  h1 = size[1]/(split[1]-1);
94  }
95 
96  // particles
97  pos[1] = position[1] - (split[1]>1 ? 0.5*size[1] : 0);
98  for(int j=0; j < split[1]; ++j) {
99  pos[0] = position[0] - (split[0]>1 ? 0.5*size[0] : 0);
100  for(int i=0; i < split[0]; ++i) {
101  SoftBodyParticle* item = new SoftBodyParticle(pos, vel, mass);
102  items.push_back(item);
103 
104  if(j == 0) _borderParticles[i] = item;
105  else if(i == split[0]-1) _borderParticles[split[0]-1+j] = item;
106  else if(j == split[1]-1) _borderParticles[split[1]+2*split[0]-3-i] = item;
107  else if(i == 0) _borderParticles[2*split[0]+2*split[1]-4-j] = item;
108  pos[0] += h0;
109  }
110  pos[1] += h1;
111  }
112 
113  // horisontal springs
114  for(int i=0; i<split[1]; i++) {
115  for(int j=0; j<split[0]-1; j++) {
116  SoftBodySpring* item = new SoftBodySpring(h0, stiffnes, damping,
117  items[split[0]*i+j], items[split[0]*i+j+1]);
118  items.push_back(item);
119  }
120  }
121 
122  // vertical springs
123  for(int i=0; i<split[1]-1; i++) {
124  for(int j=0; j<split[0]; j++) {
125  SoftBodySpring* item = new SoftBodySpring(h1, stiffnes, damping,
126  items[split[0]*i+j], items[split[0]*(i+1)+j]);
127  items.push_back(item);
128  }
129  }
130 
131  // dioganal springs
132  h = std::sqrt(h0*h0 + h1*h1);
133  stiffnes /= M_SQRT2;//XXX
134  damping /= M_SQRT2;
135  for(int i=0; i<split[1]-1; i++){
136  for(int j=0; j<split[0]-1; j++){
137  SoftBodySpring* item1 = new SoftBodySpring(h, stiffnes, damping,
138  items[split[0]*i+j], items[split[0]*(i+1)+j+1]);
139  SoftBodySpring* item2 = new SoftBodySpring(h, stiffnes, damping,
140  items[split[0]*i+j+1], items[split[0]*(i+1)+j]);
141  items.push_back(item1);
142  items.push_back(item2);
143  }
144  }
145 
146  return items;
147 }
148 
149 void SoftBody::addItems(const ItemList& items)
150 {
151  const ItemList::const_iterator end = items.end();
152  for(ItemList::const_iterator it = items.begin(); it != end; ++it) {
153  addItem(*it);
154  }
155 }
156 
157 double SoftBody::mass() const
158 {
159  double totMass = 0;
160 
161  const ItemList::const_iterator end = items().end();
162  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
163  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
164  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
165  totMass += p1->mass();
166  }
167 
168  return totMass;
169 }
170 
171 Vector2d SoftBody::position() const
172 {
173  Vector2d cmPosition = Vector2d::Zero();
174 
175  const ItemList::const_iterator end = items().end();
176  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
177  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
178  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
179  cmPosition += p1->mass() * p1->position();
180  }
181  cmPosition = cmPosition/mass();
182  return cmPosition;
183 }
184 
185 void SoftBody::setPosition(const Vector2d position)
186 {
187  Vector2d delta = position - this->position();
188 
189  const ItemList::const_iterator end = items().end();
190  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
191  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
192  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
193  p1->setPosition(p1->position() + delta);
194  }
195 }
196 
197 Vector2d SoftBody::velocity() const
198 {
199  Vector2d cmVelocity = Vector2d::Zero();
200 
201  const ItemList::const_iterator end = items().end();
202  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
203  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
204  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
205  cmVelocity += p1->mass() * p1->velocity();
206  }
207 
208  cmVelocity = cmVelocity/mass();
209  return cmVelocity;
210 }
211 
212 void SoftBody::setVelocity(const Vector2d velocity)
213 {
214  Vector2d delta = velocity - this->velocity();
215 
216  const ItemList::const_iterator end = items().end();
217  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
218  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
219  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
220  p1->setVelocity(p1->velocity() + delta);
221  }
222 }
223 
224 double SoftBody::inertia() const
225 {
226  double inertia = 0;
227  Vector2d position = this->position();
228 
229  const ItemList::const_iterator end = items().end();
230  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
231  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
232  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
233  inertia += p1->mass() * (p1->position() - position).squaredNorm();
234  }
235 
236  return inertia;
237 }
238 
239 double SoftBody::angularMomentum() const
240 {
241  double angMomentum = 0;
242  Vector2d pos = position();
243  Vector2d vel = velocity();
244 
245  const ItemList::const_iterator end = items().end();
246  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
247  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
248  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
249  angMomentum += p1->mass() * ((p1->position() - pos)[0] * (p1->velocity() - vel)[1]
250  - (p1->position() - pos)[1] * (p1->velocity() - vel)[0]) ;
251  }
252 
253  return angMomentum;
254 }
255 
256 double SoftBody::angularVelocity() const
257 {
258  return angularMomentum()/inertia();
259 }
260 
261 void SoftBody::setAngularVelocity(double angularVelocity)
262 {
263  Vector2d pos = position();
264  Vector2d vel = velocity();
265 
266  const ItemList::const_iterator end = items().end();
267  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
268  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
269  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
270  Vector2d r = p1->position() - pos;
271  Vector2d n(-r[1], r[0]);
272  double vn = (p1->velocity() - vel).dot(n);
273  p1->setVelocity(p1->velocity() + (angularVelocity - vn/r.squaredNorm())*n);
274  }
275 }
276 
277 void SoftBody::setAngularMomentum(double angularMomentum)
278 {
279  setAngularVelocity(angularMomentum/inertia());
280 }
281 
282 Vector2d SoftBody::force() const
283 {
284  Vector2d force = Vector2d::Zero();
285 
286  const ItemList::const_iterator end = items().end();
287  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
288  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
289  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
290  force += p1->force();
291  }
292 
293  return force;
294 }
295 
296 double SoftBody::torque() const
297 {
298  double torque = 0;
299  Vector2d pos = position();
300  const ItemList::const_iterator end = items().end();
301  for(ItemList::const_iterator i1 = items().begin(); i1 != end; ++i1) {
302  if(!(*i1)->metaObject()->inherits<SoftBodyParticle>()) continue;
303  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(*i1);
304  Vector2d r = p1->position() - pos;
305  torque += r[0] * p1->force()[1] - r[1] * p1->force()[0];
306  }
307 
308  return torque;
309 }
310 
311 const SoftBodyParticleList& SoftBody::borderParticles()
312 {
313  if(_borderParticles.empty() && !_borderParticleNames.isEmpty() && world()) {
314  const QStringList list = _borderParticleNames.split(',');
315  QStringList::const_iterator end = list.constEnd();
316  for(QStringList::const_iterator it = list.constBegin(); it != end; ++it) {
317  Object* obj = world()->object(*it);
318  if(!obj->metaObject()->inherits<SoftBodyParticle>()) continue;
319  SoftBodyParticle* p1 = static_cast<SoftBodyParticle*>(obj);
320  _borderParticles.push_back(p1);
321  }
322  _borderParticleNames.clear();
323  }
324  return _borderParticles;
325 }
326 
327 QString SoftBody::borderParticleNames() const
328 {
329  QString list;
330  SoftBodyParticleList::const_iterator end = _borderParticles.end();
331  for(SoftBodyParticleList::const_iterator it = _borderParticles.begin(); it != end; ++it) {
332  if(!list.isEmpty()) list.append(",");
333  list.append((*it)->name());
334  }
335  return list;
336 }
337 
338 void SoftBody::setBorderParticleNames(const QString& borderParticleNames)
339 {
340  if(_borderParticles.empty() && _borderParticleNames.isEmpty())
341  _borderParticleNames = borderParticleNames;
342 }
343 
344 void SoftBody::worldItemRemoved(Item* item)
345 {
346  if(!item) return;
347 
348  if(!item->metaObject()->inherits<SoftBodyParticle>()) return;
349  SoftBodyParticle* p = static_cast<SoftBodyParticle*>(item);
350 
351  SoftBodyParticleList::iterator i =
352  std::find(_borderParticles.begin(), _borderParticles.end(), p);
353  if(i != _borderParticles.end()) _borderParticles.erase(i);
354 }
355 
356 void SoftBody::setWorld(World* world)
357 {
358  if(world == NULL) {
359  _borderParticles.clear();
360  } else if(this->world() != NULL) {
361  const SoftBodyParticleList::iterator end = _borderParticles.end();
362  for(SoftBodyParticleList::iterator i = _borderParticles.begin(); i != end; ++i) {
363  *i = static_cast<SoftBodyParticle*>(world->object((*i)->name()));
364  }
365  }
366  ItemGroup::setWorld(world);
367 }
368 
369 }
370 
StepCore::Particle::mass
double mass() const
Get mass of the particle.
Definition: particle.h:138
StepCore::Particle::setVelocity
void setVelocity(const Vector2d &velocity)
Set velocity of the particle.
Definition: particle.h:124
StepCore::ItemGroup::item
Item * item(const QString &name) const
Get any descendant item by its name.
Definition: world.cc:191
types.h
Type to and from string convertion helpers.
StepCore::World::object
Object * object(const QString &name)
Add new item to the world.
Definition: world.cc:549
StepCore::Vector2d
Eigen::Vector2d Vector2d
Two-dimensional vector with double components.
Definition: vector.h:29
StepCore::SoftBody::setPosition
void setPosition(const Vector2d position)
Set the position of the center of mass.
Definition: softbody.cc:185
StepCore::SoftBody::_borderParticles
SoftBodyParticleList _borderParticles
Definition: softbody.h:142
StepCore::SoftBody::mass
double mass() const
Get total body mass.
Definition: softbody.cc:157
StepCore::Object
Root of the StepCore classes hierarchy.
Definition: object.h:57
StepCore::SoftBody::setAngularVelocity
void setAngularVelocity(double angularVelocity)
Set the angular velicity of the body.
Definition: softbody.cc:261
StepCore::SoftBody::worldItemRemoved
void worldItemRemoved(Item *item)
Definition: softbody.cc:344
StepCore::SoftBody::angularVelocity
double angularVelocity() const
Get the angular velicity of the body.
Definition: softbody.cc:256
StepCore::SoftBody::borderParticles
const SoftBodyParticleList & borderParticles()
Get ordered list of particles on the border of the body.
Definition: softbody.cc:311
StepCore::STEPCORE_SUPER_CLASS
STEPCORE_SUPER_CLASS(CollisionSolver)
StepCore::SoftBodyParticle
Soft body particle.
Definition: softbody.h:36
StepCore::STEPCORE_FROM_UTF8
setAngleVariance setAngularVelocityVariance STEPCORE_FROM_UTF8(QT_TRANSLATE_NOOP("Units","rad/s²"))
StepCore::Item::world
World * world() const
Get pointer to World in which this object lives.
Definition: world.h:91
StepCore::ItemGroup::addItem
virtual void addItem(Item *item)
Add new item to the group.
Definition: world.cc:94
StepCore::QT_TRANSLATE_NOOP
QT_TRANSLATE_NOOP("ObjectClass","GJKCollisionSolver")
StepCore::SoftBody::torque
double torque() const
Get the torque acting on the body.
Definition: softbody.cc:296
StepCore::SoftBodyParticleList
std::vector< SoftBodyParticle * > SoftBodyParticleList
Definition: softbody.h:60
StepCore::Item
The root class for any world items (bodies and forces)
Definition: world.h:69
StepCore::SoftBody::setBorderParticleNames
void setBorderParticleNames(const QString &borderParticleNames)
Definition: softbody.cc:338
StepCore::SoftBody::inertia
double inertia() const
Get the inrtia of the body.
Definition: softbody.cc:224
StepCore::SoftBody::setVelocity
void setVelocity(const Vector2d velocity)
Set the velocity of the center of mass.
Definition: softbody.cc:212
StepCore::SoftBody::position
Vector2d position() const
Get the position of the center of mass.
Definition: softbody.cc:171
StepCore::QT_TR_NOOP
QT_TR_NOOP("Errors class for CoulombForce")
StepCore::STEPCORE_PROPERTY_RW
STEPCORE_PROPERTY_RW(double, depth, QT_TRANSLATE_NOOP("PropertyName","depth"), QT_TRANSLATE_NOOP("Units","J"), QT_TR_NOOP("Potential depth"), depth, setDepth) STEPCORE_PROPERTY_RW(double
StepCore::Particle::force
const Vector2d & force() const
Get force that acts upon particle.
Definition: particle.h:130
StepCore::ItemGroup
Groups several items together.
Definition: world.h:309
StepCore::SoftBody::borderParticleNames
QString borderParticleNames() const
Definition: softbody.cc:327
StepCore::Force
Interface for forces.
Definition: world.h:199
StepCore::SoftBody::force
Vector2d force() const
Get the force acting on the body.
Definition: softbody.cc:282
StepCore::ItemList
std::vector< Item * > ItemList
List of pointers to Item.
Definition: world.h:298
STEPCORE_UNITS_NULL
#define STEPCORE_UNITS_NULL
Definition: object.h:365
StepCore::ItemGroup::setWorld
void setWorld(World *world)
Recursively call setWorld for all children objects.
Definition: world.cc:79
StepCore::STEPCORE_PROPERTY_RW_D
STEPCORE_PROPERTY_RW_D(StepCore::Vector2d, positionVariance, QT_TRANSLATE_NOOP("PropertyName","positionVariance"), QT_TRANSLATE_NOOP("Units","m"), QT_TR_NOOP("position variance"), positionVariance, setPositionVariance) STEPCORE_PROPERTY_RW_D(double
StepCore::Particle::setPosition
void setPosition(const Vector2d &position)
Set position of the particle.
Definition: particle.h:119
StepCore::STEPCORE_PROPERTY_R_D
setRmin setRminVariance STEPCORE_PROPERTY_R_D(double, rectPressureVariance, QT_TRANSLATE_NOOP("PropertyName","rectPressureVariance"), QT_TRANSLATE_NOOP("Units","Pa"), QT_TR_NOOP("Variance of pressure of particles in the measureRect"), rectPressureVariance) STEPCORE_PROPERTY_R_D(double
StepCore::ItemGroup::items
const ItemList & items() const
Get list of all direct child items in the ItemGroup.
Definition: world.h:326
StepCore::SoftBody
SoftBody - a group of several SoftBodyParticle and SoftBodySprings.
Definition: softbody.h:65
StepCore::SoftBody::velocity
Vector2d velocity() const
Get the velocity of the center of mass.
Definition: softbody.cc:197
StepCore::SoftBody::_borderParticleNames
QString _borderParticleNames
Definition: softbody.h:143
StepCore::Vector2i
Eigen::Vector2i Vector2i
Two-dimensional vector with integer components.
Definition: vector.h:34
StepCore::SoftBody::angularMomentum
double angularMomentum() const
Get the angular momentum of the body.
Definition: softbody.cc:239
StepCore::Particle::position
const Vector2d & position() const
Get position of the particle.
Definition: particle.h:117
StepCore::STEPCORE_META_OBJECT
STEPCORE_META_OBJECT(CollisionSolver, QT_TRANSLATE_NOOP("ObjectClass","CollisionSolver"),"CollisionSolver", MetaObject::ABSTRACT, STEPCORE_SUPER_CLASS(Object), STEPCORE_PROPERTY_RW(double, toleranceAbs, QT_TRANSLATE_NOOP("PropertyName","toleranceAbs"), STEPCORE_UNITS_1, QT_TR_NOOP("Allowed absolute tolerance"), toleranceAbs, setToleranceAbs) STEPCORE_PROPERTY_R_D(double, localError, QT_TRANSLATE_NOOP("PropertyName","localError"), STEPCORE_UNITS_1, QT_TR_NOOP("Maximal local error during last step"), localError)) STEPCORE_META_OBJECT(GJKCollisionSolver
StepCore::World
Contains multiple Item, Solver and general properties such as time.
Definition: world.h:372
StepCore::SoftBody::setAngularMomentum
void setAngularMomentum(double angularMomentum)
Set the angular momentum of the body.
Definition: softbody.cc:277
softbody.h
SoftBody-related classes.
StepCore::Particle::velocity
const Vector2d & velocity() const
Get velocity of the particle.
Definition: particle.h:122
StepCore::SoftBody::addItems
void addItems(const ItemList &items)
Adds all items to ItemGroup.
Definition: softbody.cc:149
StepCore::SoftBody::setWorld
void setWorld(World *world)
Set/change pointer to World in which this object lives.
Definition: softbody.cc:356
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

step/stepcore

Skip menu "step/stepcore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal