Changeset 2433 for code/branches/physics/src/orxonox/objects/worldentities
- Timestamp:
- Dec 14, 2008, 12:25:13 AM (16 years ago)
- Location:
- code/branches/physics/src/orxonox/objects/worldentities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/StaticEntity.cc
r2426 r2433 62 62 { 63 63 if (this->addedToPhysicalWorld()) 64 ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time."); 64 { 65 CCOUT(2) << "Warning: Attempting to change the position of a StaticEntity at physics run time. Ignoring change." << std::endl; 66 return; 67 } 65 68 if (this->isStatic()) 66 69 { … … 76 79 { 77 80 if (this->addedToPhysicalWorld()) 78 ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time."); 81 { 82 CCOUT(2) << "Warning: Attempting to change the orientation of a StaticEntity at physics run time. Ignoring change." << std::endl; 83 return; 84 } 79 85 if (this->isStatic()) 80 86 { … … 101 107 { 102 108 OrxAssert(false, "Setting world transform of a StaticEntity, which is CF_STATIC!"); 103 //COUT(0) << "Setting world transform of a StaticEntity, which is static!" << std::endl;104 109 } 105 110 -
code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc
r2429 r2433 194 194 { 195 195 if (!this->hasPhysics()) 196 ThrowException(PhysicsViolation, "Cannot attach a physical object to a non physical one."); 196 { 197 COUT(2) << "Warning: Cannot attach a physical object to a non physical one." << std::endl; 198 return; 199 } 197 200 else if (object->isDynamic()) 198 ThrowException(PhysicsViolation, "Cannot attach a dynamic object to a WorldEntity."); 201 { 202 COUT(2) << "Warning: Cannot attach a dynamic object to a WorldEntity." << std::endl; 203 return; 204 } 199 205 else if (object->isKinematic() && this->isDynamic()) 200 ThrowException(PhysicsViolation, "Cannot attach a kinematic object to a dynamic one."); 206 { 207 COUT(2) << "Warning: Cannot attach a kinematic object to a dynamic one." << std::endl; 208 return; 209 } 201 210 else if (object->isKinematic()) 202 ThrowException(NotImplemented, "Cannot attach a kinematic object to a static or kinematic one: Not yet implemented."); 211 { 212 COUT(2) << "Warning: Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << std::endl; 213 return; 214 } 203 215 else 204 216 { … … 424 436 { 425 437 if (this->hasPhysics()) 426 ThrowException(NotImplemented, "Cannot set the scale of a physical object: Not yet implemented."); 438 { 439 CCOUT(2) << "Warning: Cannot set the scale of a physical object: Not yet implemented." << std::endl; 440 return; 441 } 427 442 428 443 this->node_->setScale(scale); … … 433 448 // If we are already attached to a parent, this would be a bad idea.. 434 449 if (this->parent_) 435 ThrowException(PhysicsViolation, "Cannot set the collision type of a WorldEntity with a parent"); 450 { 451 CCOUT(2) << "Warning: Cannot set the collision type of a WorldEntity with a parent." << std::endl; 452 return; 453 } 436 454 else if (this->addedToPhysicalWorld()) 437 ThrowException(PhysicsViolation, "Cannot set the collision type at run time."); 455 { 456 CCOUT(2) << "Warning: Cannot set the collision type at run time." << std::endl; 457 return; 458 } 438 459 439 460 // Check for type legality. Could be StaticEntity or MobileEntity … … 441 462 return; // exception gets issued anyway 442 463 if (type != None && !this->getScene()->hasPhysics()) 443 ThrowException(PhysicsViolation, "Cannot have physical bodies in a non physical scene"); 464 { 465 CCOUT(2) << "Warning: Cannot have physical bodies in a non physical scene." << std::endl; 466 return; 467 } 444 468 445 469 // Check whether we have to create or destroy. … … 448 472 // Check whether there was some scaling applied. 449 473 if (!this->node_->getScale().positionEquals(Vector3(1, 1, 1), 0.001)) 450 ThrowException(NotImplemented, "Cannot create a physical body if there is scaling applied to the node: Not yet implemented."); 474 { 475 CCOUT(2) << "Warning: Cannot create a physical body if there is scaling applied to the node: Not yet implemented." << std::endl; 476 return; 477 } 451 478 452 479 // Create new rigid body
Note: See TracChangeset
for help on using the changeset viewer.