Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2433


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.

Location:
code/branches/physics/src/orxonox/objects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc

    r2429 r2433  
    100100    void CollisionShape::setScale3D(const Vector3& scale)
    101101    {
    102         ThrowException(NotImplemented, "Cannot set the scale of a collision shape: Not yet implemented.");
    103         this->updateParent();
     102        CCOUT(2) << "Warning: Cannot set the scale of a collision shape: Not yet implemented." << std::endl;
    104103    }
    105104
    106105    void CollisionShape::setScale(float scale)
    107106    {
    108         ThrowException(NotImplemented, "Cannot set the scale of a collision shape: Not yet implemented.");
    109         this->updateParent();
     107        CCOUT(2) << "Warning: Cannot set the scale of a collision shape: Not yet implemented." << std::endl;
    110108    }
    111109
  • code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc

    r2423 r2433  
    7272        if (this->childShapes_.find(shape) != this->childShapes_.end())
    7373        {
    74             ThrowException(NotImplemented, "Warning: Attaching a CollisionShape twice is not yet supported.");
     74            CCOUT(2) << "Warning: Attaching a CollisionShape twice is not yet supported." << std::endl;
    7575            return;
    7676        }
  • code/branches/physics/src/orxonox/objects/worldentities/StaticEntity.cc

    r2426 r2433  
    6262    {
    6363        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        }
    6568        if (this->isStatic())
    6669        {
     
    7679    {
    7780        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        }
    7985        if (this->isStatic())
    8086        {
     
    101107    {
    102108        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;
    104109    }
    105110
  • 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.