本文整理汇总了C++中fairy::LogicModel::getPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LogicModel::getPosition方法的具体用法?C++ LogicModel::getPosition怎么用?C++ LogicModel::getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fairy::LogicModel
的用法示例。
在下文中一共展示了LogicModel::getPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseMove
void ActorSceneCanvas::OnMouseMove(wxMouseEvent& e)
{
ShowPos(e.GetX(), e.GetY());
if (!GetSceneManipulator())
return;
if (m_pCameraManip)
{
wxASSERT(mDragButton != wxMOUSE_BTN_NONE);
m_pCameraManip->onMotion(e.GetX(), e.GetY());
}
if (mDragStarted && e.LeftIsDown())
{
mDragCurrent =Ogre::Vector2(e.GetX(), e.GetY()) ;
mDragDelta = mDragCurrent - mDragOrigin;
mDragOrigin = mDragCurrent;
if (Fairy::CDataManipulator::GetDataManipulator() && mCanManipulateAxis)
{
Ogre::Camera* camera = GetSceneManipulator()->getCamera();
assert (camera);
Ogre::Vector3 oldPos = camera->getPosition();
Fairy::LogicModel* pModel = GetDataManipulator()->m_pObjTemplate;
if (pModel)
{
Ogre::Vector3 objPos = pModel->getPosition();
Ogre::Real distance = oldPos.distance(objPos);
Ogre::Real factor = distance*0.1/150.0;
Ogre::Vector3 pos=Fairy::CDataManipulator::m_baseNode->getPosition();
Ogre::Vector3 fdeltaxi = Ogre::Vector3::ZERO;
Ogre::Quaternion qRot = Fairy::CDataManipulator::m_baseNode->getOrientation();
//david-<<
if(mXax)
fdeltaxi = /*qRot**/(mDragDelta.x*0.1*Ogre::Vector3::UNIT_X);
if(mYax)
fdeltaxi = /*qRot**/(mDragDelta.x*0.1*Ogre::Vector3::UNIT_Y);
if(mZax)
fdeltaxi = /*qRot**/(mDragDelta.x*0.1*Ogre::Vector3::UNIT_Z);
//david->>
Fairy::CDataManipulator::GetDataManipulator()->_updateCurLocatorTrans(fdeltaxi,Ogre::Quaternion::IDENTITY,true);
}
}
}
if(mDragRightStarted && e.RightIsDown())
{
mDragCurrent =Ogre::Vector2(e.GetX(), e.GetY()) ;
mDragDelta = mDragCurrent - mDragOrigin;
mDragOrigin = mDragCurrent;
// Ogre::Radian x = Ogre::Degree(mDragDelta.val[0]);
// Ogre::Radian y = Ogre::Degree(mDragDelta.val[1]);
// Fairy::CDataManipulator::m_axex->yaw(y);
// Fairy::CDataManipulator::m_axex->pitch(x);
if ( Fairy::CDataManipulator::GetDataManipulator() &&(mXax || mYax || mZax) && mCanManipulateAxis)
{
Ogre::Vector3 fBaseAxis = Ogre::Vector3::ZERO;
Ogre::Quaternion fBaseRot = Fairy::CDataManipulator::m_baseNode->getOrientation();
if(mXax)
fBaseAxis =/* fBaseRot**/Ogre::Vector3::UNIT_X;
if(mYax)
fBaseAxis =/* fBaseRot**/Ogre::Vector3::UNIT_Y;
if(mZax)
fBaseAxis =/* fBaseRot**/Ogre::Vector3::UNIT_Z;
//david-<<
Ogre::Radian angle = Ogre::Degree(mDragDelta.y);
//david->>
Ogre::Quaternion rot(angle, fBaseAxis);
if(mRotFirst)
{
Fairy::CDataManipulator::GetDataManipulator()->_updateCurLocatorTrans(Ogre::Vector3::ZERO, rot, false);
}
else
{
Fairy::CDataManipulator::GetDataManipulator()->_updateCurLocatorRot(rot);
}
}
}
if (GetActiveAction())
{
//GetActiveAction()->onMotion(e.GetX(), e.GetY());
if (e.ControlDown())
{
GetActiveAction()->setParameter("FUNC_KEY", "CTRL");
}
//.........这里部分代码省略.........