本文整理汇总了C++中ois::Mouse::setMousePosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Mouse::setMousePosition方法的具体用法?C++ Mouse::setMousePosition怎么用?C++ Mouse::setMousePosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ois::Mouse
的用法示例。
在下文中一共展示了Mouse::setMousePosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
//.........这里部分代码省略.........
CommonDeclarations::GetApplication()->SetCurrentCamera(EditorCamera);
/*CommonDeclarations::ObjectsPool *objects = CommonDeclarations::GetEditableObjects();
for (CommonDeclarations::ObjectsPool::ListNode *pos = objects->GetBegin();pos!=NULL;pos=pos->Next)
{
SEditableObject obj;
obj.Object = pos->Value;
IScenable *scen = pos->Value->GetScenable();
if (scen)
{
obj.EditNode = NULL;
obj.EditEntity = NULL;
ICollidable *collid = pos->Value->GetCollidable();
if (collid)
{
obj.CollisionModel = collid->GetCollisionModel();
} else
{
const char *modelname = scen->GetModelName();
if (NULL == modelname)
modelname = AAUtilities::StringCopy("cube.mesh");
obj.CollisionModel = GetCollisionModel(modelname);
}
} else
{
obj.EditNode = scene_manager->getRootSceneNode()->createChildSceneNode();
char *buffer = CommonDeclarations::GenGUID();
obj.EditEntity = scene_manager->createEntity(buffer, "cube.mesh");
delete [] buffer;
obj.EditNode->attachObject(obj.EditEntity);
obj.CollisionModel = GetCollisionModel("cube.mesh");
}
EditableObjects.PushBack(obj);
}
delete objects;*/
//
CommonDeclarations::ObjectsPool *objects = CommonDeclarations::GetEditableObjects();
const char *str;
TiXmlElement *node = 0, *nodes, *env;
env = SceneRootElement->FirstChildElement("environment");
if (env)
{
node = env->FirstChildElement("skyBox");
if (node)
{
SEditableDescription descr;
descr.EditNode = NULL;
descr.EditElement = node;
EditorNodes.insert(std::make_pair("SkyBox", descr));
}
}
nodes = SceneRootElement->FirstChildElement("nodes");
if (nodes)
{
node = nodes->FirstChildElement("node");
Ogre::Node::ChildNodeIterator iFirst = scene_manager->getRootSceneNode()->getChildIterator(), iPos = iFirst;
while (node)
{
str = node->Attribute("name");
SEditableDescription descr;
Ogre::Node *t = NULL;
iPos = iFirst;
while (iPos.hasMoreElements())
{
t = iPos.getNext();
if (t->getName()==str)
{
descr.EditNode = t;
break;
}
}
descr.EditElement = node;
EditorNodes.insert(std::make_pair(str, descr));
node = node->NextSiblingElement("node");
}
}
delete objects;
//
MyGUI::Gui *gui = GUISystem::GetInstance()->GetGui();
OIS::Mouse *mouse = EditorFrameListener::GetInstance()->GetMouse();
InitGUI();
const OIS::MouseState &ms = mouse->getMouseState();
int x=ms.width/2,
y=ms.height/2;
mouse->setMousePosition(x,y);
gui->setPointerPosition(x, y);
gui->showPointer();
}