本文整理汇总了C++中ISceneNode::bInScene方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneNode::bInScene方法的具体用法?C++ ISceneNode::bInScene怎么用?C++ ISceneNode::bInScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneNode
的用法示例。
在下文中一共展示了ISceneNode::bInScene方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onMessage
bool xObjPlacement::onMessage(NS_XEVOL3D::xWindowMsg& msg)
{
if(msg.MsgID == NS_XEVOL3D::WIN_KEYUP)
{
if(msg.Keyboard.nSysVKey == VK_ESCAPE)
{
}
}
if(msg.MsgID == NS_XEVOL3D::WIN_RMOUSE_DOWN)
{
xTextureDesc _desc;
int x = msg.Mouse.x;
int y = msg.Mouse.y;
xvec2i* pRTData = m_pEvolEnv->GetSelectData(_desc , x , y );
xvec2i& val = pRTData[ y * _desc.m_width + x];
ISceneNode* pSelNode = NULL;
if(val.x > 10000)
{
//val.x = xRoundToByte(val.x, 4);
pSelNode = dynamic_cast<ISceneNode*> ( (IBaseObject*)val.x);
}
//检查时不是点中了那个旋转的Gizmo
m_RotateAxis = -1;
for(int _i = -3 ; _i < 3 ; _i ++)
{
for(int _j = -3 ; _j < 3 ; _j ++)
{
int _x = x + _i;
int _y = y + _j;
if(_x >=0 && _x < _desc.m_width && _y >= 0 && _y < _desc.m_height)
{
xvec2i& val = pRTData[ _y * _desc.m_width + _x];
if(val.x == (int)m_SceneSelection->GetRotGizmo())
{
m_RotateAxis = val.y;
m_lastDragPos = xvec2i(x , y);
return true;
}
}
}
}
//如果是Node不属于场景。就啥也不做。
if(pSelNode && pSelNode->bInScene() == false )
{
return true;
}
m_SceneSelection->setGizmoNode(NULL);
setCurSelNode(NULL);
if(pSelNode)
{
setCurSelNode(pSelNode);
}
if( GetCurSelNode() )
{
m_bInDrag = true;
m_lastDragPos = xvec2i(x , y);
if(m_placementType == eOPT_Rotate)
{
m_SceneSelection->setRotGizmo();
}
else if(m_placementType == eOPT_Move)
{
m_SceneSelection->setMoveGizmo();
}
}
m_pEvolEnv->ReleaseSelectData(pRTData);
return true;
}
if(msg.MsgID == NS_XEVOL3D::WIN_MOUSE_MOVE)
{
if(GetCurSelNode() == NULL)
return true;
int x = msg.Mouse.x;
int y = msg.Mouse.y;
if(m_bInDrag)
{
float movPercent;
if(m_SceneSelection->GetCurSelNode() == NULL)
return false;
xvec4 movDir = getMouseMoveDir(x , y , movPercent);
xvec3 ModelPos ;
GetCurSelNode()->placement()->getPosition( ModelPos);
ModelPos = ModelPos + movDir;
GetCurSelNode()->placement()->setPosition(ModelPos);
GetCurSelNode()->updateChildrenTrans();
}
else if(m_RotateAxis >= 0 )
{
float movPercent;
//.........这里部分代码省略.........