Changeset 10288 for code/trunk/src/orxonox/worldentities/WorldEntity.h
- Timestamp:
- Feb 28, 2015, 11:55:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/worldentities/WorldEntity.h
r10216 r10288 355 355 { return this->friction_; } 356 356 357 /** 358 * Sets the motion threshold for continuous collision detection (CCD). This should be activated if an object moves further in one tick than its own 359 * size. This means that in one tick the object may be in front of a wall and in the next tick it will be behind the wall without ever triggering a 360 * collision. CCD ensures that collisions are still detected. By default it is deactivated (threshold = 0) which is fine for slow or static 361 * objects, but it should be set to a real value for fast moving objects (e.g. projectiles). 362 * 363 * A good value for the threshold is (diameter^2). 364 * 365 * @param ccdMotionThreshold CCD is enabled if the squared velocity of the object is > ccdMotionThreshold (default 0.0). 0.0 means deactivated. 366 */ 367 inline void setCcdMotionThreshold(float ccdMotionThreshold) 368 { this->ccdMotionThreshold_ = ccdMotionThreshold; internalSetPhysicsProps(); } 369 //! Returns the currently used motion threshold for CCD (0 means CCD is deactivated). 370 inline float getCcdMotionThreshold() const 371 { return this->ccdMotionThreshold_; } 372 373 /** 374 * Sets the radius of the sphere which is used for continuous collision detection (CCD). The sphere should be embedded inside the objects collision 375 * shape, preferably smaller. @see setCcdMotionThreshold for more information about CCD. 376 * 377 * A good value for the radius is (diameter/5). 378 * 379 * @param ccdSweptSphereRadius The diameter of the sphere which is used for CCD (default 0.0). 380 */ 381 inline void setCcdSweptSphereRadius(float ccdSweptSphereRadius) 382 { this->ccdSweptSphereRadius_ = ccdSweptSphereRadius; internalSetPhysicsProps(); } 383 //! Returns the currently used radius of the sphere for CCD. 384 inline float getCcdSweptSphereRadius() const 385 { return this->ccdSweptSphereRadius_; } 386 357 387 void attachCollisionShape(CollisionShape* shape); 358 388 void detachCollisionShape(CollisionShape* shape); … … 438 468 inline void frictionChanged() 439 469 { this->setFriction(this->friction_); } 470 //! Network callback workaround to call a function when the value changes. 471 inline void ccdMotionThresholdChanged() 472 { this->setCcdMotionThreshold(this->ccdMotionThreshold_); } 473 //! Network callback workaround to call a function when the value changes. 474 inline void ccdSweptSphereRadiusChanged() 475 { this->setCcdSweptSphereRadius(this->ccdSweptSphereRadius_); } 440 476 441 477 CollisionType collisionType_; //!< @see setCollisionType … … 454 490 btScalar friction_; //!< @see setFriction 455 491 btScalar childrenMass_; //!< Sum of all the children's masses 492 btScalar ccdMotionThreshold_; //!< @see setCcdMotionThreshold 493 btScalar ccdSweptSphereRadius_; //!< @see setCcdSweptSphereRadius 456 494 bool bCollisionCallbackActive_; //!< @see enableCollisionCallback 457 495 bool bCollisionResponseActive_; //!< Tells whether the object should respond to collisions
Note: See TracChangeset
for help on using the changeset viewer.