Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2008, 12:25:13 AM (15 years ago)
Author:
rgrieder
Message:

Replaced most Exception throwing considering physics with warnings. Actions are simply ignored then.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc

    r2429 r2433  
    194194        {
    195195            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            }
    197200            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            }
    199205            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            }
    201210            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            }
    203215            else
    204216            {
     
    424436    {
    425437        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        }
    427442
    428443        this->node_->setScale(scale);
     
    433448        // If we are already attached to a parent, this would be a bad idea..
    434449        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        }
    436454        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        }
    438459
    439460        // Check for type legality. Could be StaticEntity or MobileEntity
     
    441462            return; // exception gets issued anyway
    442463        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        }
    444468
    445469        // Check whether we have to create or destroy.
     
    448472            // Check whether there was some scaling applied.
    449473            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            }
    451478
    452479            // Create new rigid body
Note: See TracChangeset for help on using the changeset viewer.