[Orxonox-commit 593] r3125 - in branches/pch/src: core/input orxonox/objects orxonox/objects/collisionshapes orxonox/overlays/stats util
rgrieder at orxonox.net
rgrieder at orxonox.net
Tue Jun 9 14:48:32 CEST 2009
Author: rgrieder
Date: 2009-06-09 14:48:32 +0200 (Tue, 09 Jun 2009)
New Revision: 3125
Modified:
branches/pch/src/core/input/InputManager.cc
branches/pch/src/orxonox/objects/Scene.cc
branches/pch/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc
branches/pch/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc
branches/pch/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc
branches/pch/src/orxonox/overlays/stats/Scoreboard.cc
branches/pch/src/util/Convert.h
Log:
Renamed stupid omni_cast to multi_cast. It still eats about anything ;)
Modified: branches/pch/src/core/input/InputManager.cc
===================================================================
--- branches/pch/src/core/input/InputManager.cc 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/core/input/InputManager.cc 2009-06-09 12:48:32 UTC (rev 3125)
@@ -366,8 +366,8 @@
for (unsigned int i = 0; i < configValueVectorSize; ++i)
{
- list[i] = omni_cast<int>(ConfigFileManager::getInstance().getValue(
- ConfigFileType::JoyStickCalibration, sectionName, valueName, i, omni_cast<std::string>(defaultValue), false));
+ list[i] = multi_cast<int>(ConfigFileManager::getInstance().getValue(
+ ConfigFileType::JoyStickCalibration, sectionName, valueName, i, multi_cast<std::string>(defaultValue), false));
}
// fill the rest with default values
@@ -402,18 +402,18 @@
{
// Generate some sort of execution unique id per joy stick
std::string id = "JoyStick_";
- id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button)) + "_";
- id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis)) + "_";
- id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider)) + "_";
- id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV)) + "_";
- id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
+ id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button)) + "_";
+ id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis)) + "_";
+ id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider)) + "_";
+ id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV)) + "_";
+ id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
id += joySticks_[iJoyStick]->vendor();
for (unsigned int i = 0; i < iJoyStick; ++i)
{
if (id == joyStickIDs_[i])
{
// Two joysticks are probably equal --> add the index as well
- id += "_" + omni_cast<std::string>(iJoyStick);
+ id += "_" + multi_cast<std::string>(iJoyStick);
}
}
joyStickIDs_[iJoyStick] = id;
@@ -496,17 +496,17 @@
if (joyStickMinValues_[iJoyStick][i] == INT_MAX)
joyStickMinValues_[iJoyStick][i] = -32768;
ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
- this->joyStickIDs_[iJoyStick], "MinValue", i, omni_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
+ this->joyStickIDs_[iJoyStick], "MinValue", i, multi_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
// Maximum values
if (joyStickMaxValues_[iJoyStick][i] == INT_MIN)
joyStickMaxValues_[iJoyStick][i] = 32767;
ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
- this->joyStickIDs_[iJoyStick], "MaxValue", i, omni_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
+ this->joyStickIDs_[iJoyStick], "MaxValue", i, multi_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
// Middle values
ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
- this->joyStickIDs_[iJoyStick], "MiddleValue", i, omni_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
+ this->joyStickIDs_[iJoyStick], "MiddleValue", i, multi_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
}
}
Modified: branches/pch/src/orxonox/objects/Scene.cc
===================================================================
--- branches/pch/src/orxonox/objects/Scene.cc 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/orxonox/objects/Scene.cc 2009-06-09 12:48:32 UTC (rev 3125)
@@ -138,7 +138,7 @@
if (range.length() < 10.0f)
{
CCOUT(2) << "Warning: Setting the negative world range to a very small value: "
- << omni_cast<std::string>(range) << std::endl;
+ << multi_cast<std::string>(range) << std::endl;
}
if (this->hasPhysics())
{
@@ -157,7 +157,7 @@
if (range.length() < 10.0f)
{
CCOUT(2) << "Warning: Setting the positive world range to a very small value: "
- << omni_cast<std::string>(range) << std::endl;
+ << multi_cast<std::string>(range) << std::endl;
}
if (this->hasPhysics())
{
@@ -175,7 +175,7 @@
{
this->gravity_ = gravity;
if (this->hasPhysics())
- this->physicalWorld_->setGravity(omni_cast<btVector3>(this->gravity_));
+ this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_));
}
void Scene::setPhysicalWorld(bool wantPhysics)
@@ -186,13 +186,13 @@
// Note: These are all little known default classes and values.
// It would require further investigation to properly dertermine the right choices.
this->broadphase_ = new bt32BitAxisSweep3(
- omni_cast<btVector3>(this->negativeWorldRange_), omni_cast<btVector3>(this->positiveWorldRange_));
+ multi_cast<btVector3>(this->negativeWorldRange_), multi_cast<btVector3>(this->positiveWorldRange_));
this->collisionConfig_ = new btDefaultCollisionConfiguration();
this->dispatcher_ = new btCollisionDispatcher(this->collisionConfig_);
this->solver_ = new btSequentialImpulseConstraintSolver();
this->physicalWorld_ = new btDiscreteDynamicsWorld(this->dispatcher_, this->broadphase_, this->solver_, this->collisionConfig_);
- this->physicalWorld_->setGravity(omni_cast<btVector3>(this->gravity_));
+ this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_));
// also set the collision callback variable.
// Note: This is a global variable which we assign a static function.
Modified: branches/pch/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc
===================================================================
--- branches/pch/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc 2009-06-09 12:48:32 UTC (rev 3125)
@@ -71,6 +71,6 @@
btCollisionShape* BoxCollisionShape::createNewShape() const
{
- return new btBoxShape(omni_cast<btVector3>(this->halfExtents_));
+ return new btBoxShape(multi_cast<btVector3>(this->halfExtents_));
}
}
Modified: branches/pch/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- branches/pch/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc 2009-06-09 12:48:32 UTC (rev 3125)
@@ -88,7 +88,7 @@
if (shape->getCollisionShape())
{
// Only actually attach if we didn't pick a CompoundCollisionShape with no content
- btTransform transf(omni_cast<btQuaternion>(shape->getOrientation()), omni_cast<btVector3>(shape->getPosition()));
+ btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition()));
this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
this->updatePublicShape();
@@ -133,7 +133,7 @@
if (shape->getCollisionShape())
{
// Only actually attach if we didn't pick a CompoundCollisionShape with no content
- btTransform transf(omni_cast<btQuaternion>(shape->getOrientation()), omni_cast<btVector3>(shape->getPosition()));
+ btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition()));
this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
it->second = shape->getCollisionShape();
}
Modified: branches/pch/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc
===================================================================
--- branches/pch/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc 2009-06-09 12:48:32 UTC (rev 3125)
@@ -71,6 +71,6 @@
btCollisionShape* PlaneCollisionShape::createNewShape() const
{
- return new btStaticPlaneShape(omni_cast<btVector3>(this->normal_), this->offset_);
+ return new btStaticPlaneShape(multi_cast<btVector3>(this->normal_), this->offset_);
}
}
Modified: branches/pch/src/orxonox/overlays/stats/Scoreboard.cc
===================================================================
--- branches/pch/src/orxonox/overlays/stats/Scoreboard.cc 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/orxonox/overlays/stats/Scoreboard.cc 2009-06-09 12:48:32 UTC (rev 3125)
@@ -100,9 +100,9 @@
unsigned int index = 0;
for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it)
{
- this->lines_[index]->setPlayerName(omni_cast<std::string>(it->first->getName()));
- this->lines_[index]->setScore(omni_cast<std::string>(it->second.frags_));
- this->lines_[index]->setDeaths(omni_cast<std::string>(it->second.killed_));
+ this->lines_[index]->setPlayerName(multi_cast<std::string>(it->first->getName()));
+ this->lines_[index]->setScore(multi_cast<std::string>(it->second.frags_));
+ this->lines_[index]->setDeaths(multi_cast<std::string>(it->second.killed_));
index++;
}
Modified: branches/pch/src/util/Convert.h
===================================================================
--- branches/pch/src/util/Convert.h 2009-06-09 12:42:19 UTC (rev 3124)
+++ branches/pch/src/util/Convert.h 2009-06-09 12:48:32 UTC (rev 3125)
@@ -369,7 +369,7 @@
// Like getConvertedValue, but the template argument order is in reverse.
// That means you can call it exactly like static_cast<ToType>(fromTypeValue).
template<class ToType, class FromType>
- inline ToType omni_cast(const FromType& input)
+ inline ToType multi_cast(const FromType& input)
{
ToType output;
convertValue(&output, input);
More information about the Orxonox-commit
mailing list