Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 23, 2011, 12:45:53 AM (13 years ago)
Author:
landauf
Message:

merged output branch back to trunk.

Changes:

  • you have to include util/Output.h instead of util/Debug.h
  • COUT(x) is now called orxout(level)
  • output levels are now defined by an enum instead of numbers. see util/Output.h for the definition
  • it's possible to use output contexts with orxout(level, context). see util/Output.h for some common contexts. you can define more contexts
  • you must use 'endl' at the end of an output message, '\n' does not flush the message

Output levels:

  • instead of COUT(0) use orxout()
  • instead of COUT(1) use orxout(user_error) or orxout(internal_error)
  • instead of COUT(2) use orxout(user_warning) or orxout(internal_warning)
  • instead of COUT(3) use orxout(user_status/user_info) or orxout(internal_status/internal_info)
  • instead of COUT(4) use orxout(verbose)
  • instead of COUT(5) use orxout(verbose_more)
  • instead of COUT(6) use orxout(verbose_ultra)

Guidelines:

  • user_* levels are for the user, visible in the console and the log-file
  • internal_* levels are for developers, visible in the log-file
  • verbose_* levels are for debugging, only visible if the context of the output is activated

Usage in C++:

  • orxout() << "message" << endl;
  • orxout(level) << "message" << endl;
  • orxout(level, context) << "message" << endl;

Usage in Lua:

  • orxout("message")
  • orxout(orxonox.level.levelname, "message")
  • orxout(orxonox.level.levelname, "context", "message")

Usage in Tcl (and in the in-game-console):

  • orxout levelname message
  • orxout_context levelname context message
  • shortcuts: log message, error message, warning message, status message, info message, debug message
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r8706 r8858  
    9595        this->collisionType_             = None;
    9696        this->collisionTypeSynchronised_ = None;
    97         this->mass_           = 0;
     97        this->mass_           = 1.0f;
    9898        this->childrenMass_   = 0;
    9999        // Using bullet default values
     
    311311            this->collisionTypeSynchronised_ != None)
    312312        {
    313             CCOUT(1) << "Error when collsion Type was received over network. Unknown enum value:" << this->collisionTypeSynchronised_ << std::endl;
     313            orxout(internal_error) << "Error when collsion Type was received over network. Unknown enum value:" << this->collisionTypeSynchronised_ << endl;
    314314        }
    315315        else if (this->collisionTypeSynchronised_ != collisionType_)
    316316        {
    317317            if (this->parent_)
    318                 CCOUT(2) << "Warning: Network connection tried to set the collision type of an attached WE. Ignoring." << std::endl;
     318                orxout(internal_warning) << "Network connection tried to set the collision type of an attached WE. Ignoring." << endl;
    319319            else
    320320                this->setCollisionType(this->collisionTypeSynchronised_);
     
    373373        if (object == this)
    374374        {
    375             COUT(2) << "Warning: Can't attach a WorldEntity to itself." << std::endl;
     375            orxout(internal_warning) << "Can't attach a WorldEntity to itself." << endl;
    376376            return;
    377377        }
     
    406406            if (!newParent->hasPhysics())
    407407            {
    408                 COUT(2) << "Warning: Cannot attach a physical object to a non physical one." << std::endl;
     408                orxout(internal_warning) << " Cannot attach a physical object to a non physical one." << endl;
    409409                return false;
    410410            }
    411411            else if (this->isDynamic())
    412412            {
    413                 COUT(2) << "Warning: Cannot attach a dynamic object to a WorldEntity." << std::endl;
     413                orxout(internal_warning) << "Cannot attach a dynamic object to a WorldEntity." << endl;
    414414                return false;
    415415            }
    416416            else if (this->isKinematic() && newParent->isDynamic())
    417417            {
    418                 COUT(2) << "Warning: Cannot attach a kinematic object to a dynamic one." << std::endl;
     418                orxout(internal_warning) << "Cannot attach a kinematic object to a dynamic one." << endl;
    419419                return false;
    420420            }
    421421            else if (this->isKinematic())
    422422            {
    423                 COUT(2) << "Warning: Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << std::endl;
     423                orxout(internal_warning) << "Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << endl;
    424424                return false;
    425425            }
     
    455455        if (it == this->children_.end())
    456456        {
    457             CCOUT(2) << "Warning: Cannot detach an object that is not a child." << std::endl;
     457            orxout(internal_warning) << "Cannot detach an object that is not a child." << endl;
    458458            return;
    459459        }
     
    799799        if (this->parent_)
    800800        {
    801             CCOUT(2) << "Warning: Cannot set the collision type of a WorldEntity with a parent." << std::endl;
     801            orxout(internal_warning) << "Cannot set the collision type of a WorldEntity with a parent." << endl;
    802802            return;
    803803        }
     
    822822            if (!this->node_->getScale().positionEquals(Vector3(1, 1, 1), 0.001))
    823823            {
    824                 CCOUT(2) << "Warning: Cannot create a physical body if there is scaling applied to the node: Not yet implemented." << std::endl;
     824                orxout(internal_warning) << "Cannot create a physical body if there is scaling applied to the node: Not yet implemented." << endl;
    825825                return;
    826826            }
     
    968968                this->physicalBody_->setMassProps(0.0f, btVector3(0, 0, 0));
    969969            }
    970             else if ((this->mass_ + this->childrenMass_) == 0.0f)
     970            else if (totalMass == 0.0f)
    971971            {
    972972                // Use default values to avoid very large or very small values
    973                 CCOUT(4) << "Warning: Setting the internal physical mass to 1.0 because mass_ is 0.0" << std::endl;
     973                orxout(internal_warning) << "Setting the internal physical mass to 1.0 because mass_ is 0.0" << endl;
    974974                btVector3 inertia(0, 0, 0);
    975975                this->collisionShape_->calculateLocalInertia(1.0f, inertia);
Note: See TracChangeset for help on using the changeset viewer.