本文整理汇总了C++中ogre::Degree::valueRadians方法的典型用法代码示例。如果您正苦于以下问题:C++ Degree::valueRadians方法的具体用法?C++ Degree::valueRadians怎么用?C++ Degree::valueRadians使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Degree
的用法示例。
在下文中一共展示了Degree::valueRadians方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WorkFromThread_Ogre
//------------------------------------------------------------------------
void TApplySetup_CameraUp::WorkFromThread_Ogre()
{
Ogre::Camera* pCamera = TModuleLogic::Get()->GetC()->pGraphicEngine->GetGE()->GetCamera();
nsMathTools::TVector3 point(0,0,0);
pCamera->setPosition(point.x, point.y, point.z);
pCamera->lookAt(mVCameraUp.x, mVCameraUp.y, mVCameraUp.z);
Ogre::Degree degree;
degree = 90;
Ogre::Radian rad;
rad = degree.valueRadians();
pCamera->pitch(rad);
}
示例2: UpdateVehicle
void LandVehicleSimulation::UpdateVehicle(Actor* vehicle, float seconds_since_last_frame)
{
if (vehicle->isBeingReset() || vehicle->ar_physics_paused || vehicle->ar_replay_mode)
return;
#ifdef USE_ANGELSCRIPT
if (vehicle->ar_vehicle_ai && vehicle->ar_vehicle_ai->IsActive())
return;
#endif // USE_ANGELSCRIPT
EngineSim* engine = vehicle->ar_engine;
if (engine && engine->HasStarterContact() &&
engine->GetAutoShiftMode() == SimGearboxMode::AUTO &&
engine->getAutoShift() != EngineSim::NEUTRAL)
{
Ogre::Vector3 dirDiff = vehicle->getDirection();
Ogre::Degree pitchAngle = Ogre::Radian(asin(dirDiff.dotProduct(Ogre::Vector3::UNIT_Y)));
if (std::abs(pitchAngle.valueDegrees()) > 2.0f)
{
if (engine->getAutoShift() > EngineSim::NEUTRAL && vehicle->ar_avg_wheel_speed < +0.02f && pitchAngle.valueDegrees() > 0.0f ||
engine->getAutoShift() < EngineSim::NEUTRAL && vehicle->ar_avg_wheel_speed > -0.02f && pitchAngle.valueDegrees() < 0.0f)
{
// anti roll back in SimGearboxMode::AUTO (DRIVE, TWO, ONE) mode
// anti roll forth in SimGearboxMode::AUTO (REAR) mode
float g = std::abs(App::GetSimTerrain()->getGravity());
float downhill_force = std::abs(sin(pitchAngle.valueRadians()) * vehicle->getTotalMass()) * g;
float engine_force = std::abs(engine->GetTorque()) / vehicle->getAvgPropedWheelRadius();
float ratio = std::max(0.0f, 1.0f - (engine_force / downhill_force));
if (vehicle->ar_avg_wheel_speed * pitchAngle.valueDegrees() > 0.0f)
{
ratio *= sqrt((0.02f - vehicle->ar_avg_wheel_speed) / 0.02f);
}
vehicle->ar_brake = sqrt(ratio);
}
}
else if (vehicle->ar_brake == 0.0f && !vehicle->ar_parking_brake && engine->GetTorque() == 0.0f)
{
float ratio = std::max(0.0f, 0.2f - std::abs(vehicle->ar_avg_wheel_speed)) / 0.2f;
vehicle->ar_brake = ratio;
}
}
if (vehicle->cc_mode)
{
LandVehicleSimulation::UpdateCruiseControl(vehicle, seconds_since_last_frame);
}
if (vehicle->sl_enabled)
{
LandVehicleSimulation::CheckSpeedLimit(vehicle, seconds_since_last_frame);
}
}