当前位置: 首页>>代码示例>>C++>>正文


C++ CGroupMap::addDeco方法代码示例

本文整理汇总了C++中CGroupMap::addDeco方法的典型用法代码示例。如果您正苦于以下问题:C++ CGroupMap::addDeco方法的具体用法?C++ CGroupMap::addDeco怎么用?C++ CGroupMap::addDeco使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGroupMap的用法示例。


在下文中一共展示了CGroupMap::addDeco方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update

//***************************************************************
void CAutoGroup::update(const CVector &testPos, const std::string &paletteEntry, bool valid)
{
	//H_AUTO(R2_CAutoGroup_update)
	_TestPos = testPos;
	_PaletteEntry = paletteEntry;
	_AutoGroupEnabled = valid;
	CInstance *candidate = getGroupingCandidate();
	if (!candidate && _AutoGroup.isAddedToWorldMap())
	{
		clear();
	}
	else if (candidate)
	{
		// update the display
		if (!_AutoGroup.isAddedToWorldMap())
		{
			CGroupMap *gm = CTool::getWorldMap();
			if (gm)
			{
				gm->addDeco(&_AutoGroup);
			}
		}
		CDisplayerVisual *dv = candidate->getDisplayerVisual();
		nlassert(dv); // should not be null because getGrou^pingCandidate succeeded
		_PrimRenderVertices.resize(2);
		CVector pos = dv->isCompound() ? dv->getSon(0)->getWorldPos() : dv->getWorldPos();
		_PrimRenderVertices[0] = pos;
		_PrimRenderVertices[1] = _TestPos;
		_AutoGroup.setVertices(_PrimRenderVertices);
		_AutoGroup.addDecalsToRenderList();
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:33,代码来源:auto_group.cpp

示例2: updateWorldMapPresence

// *********************************************************************************************************
void CDisplayerVisualEntity::updateWorldMapPresence()
{
	//H_AUTO(R2_CDisplayerVisualEntity_updateWorldMapPresence)
	if (!getActive()) return;
	// if not in current map then remove
	// if entity not in that map then ignore
	bool inIsland = false;
	CIslandCollision &col = getEditor().getIslandCollision();
	R2::CScenarioEntryPoints::CCompleteIsland	*currIsland = col.getCurrIslandDesc();
	if (currIsland)
	{
		inIsland = currIsland->isIn(getWorldPos2f());
	}
	// in map (displayed only if selectable for now)
	if (getDisplayedInstance()->getSelectable() && inIsland)
	{
		if (!_MapDeco.isAddedToMap())
		{
			CGroupMap *gm = CTool::getWorldMap();
			if (gm)
			{
				_MapDeco.setDisplayedInstance(getDisplayedInstance(), true);
				// retrieve icon from the displayed object (lua code)
				CLuaState &ls = getEditor().getLua();
				std::string texName = "";
				{
					CLuaStackChecker lsc(&ls);
					if (getDisplayedInstance()->getLuaProjection().callMethodByNameNoThrow("getSelectBarIcon", 0, 1))
					{
						texName = ls.toString(-1);
						ls.pop();
					}
				}
				gm->addDeco(&_MapDeco);
				_MapDeco.setCloseTexture(texName);
				_MapDeco.invalidateCoords();
			}
		}
	}
	else
	{
		if (_MapDeco.isAddedToMap())
		{
			CGroupMap *gm = CTool::getWorldMap();
			if (gm)
			{
				gm->removeDeco(&_MapDeco);
			}
		}
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:52,代码来源:displayer_visual_entity.cpp

示例3: setActive

// *********************************************************************************************************
void CDisplayerVisualShape::setActive(bool active)
{
	//H_AUTO(R2_CDisplayerVisualShape_setActive)
	if (active == _Active) return;
	if (!active)
	{
		deleteShape();
	}
	else
	{
		if (!_MapDeco.isAddedToMap() && _WorldMapDisplay)
		{
			CGroupMap *gm = CTool::getWorldMap();
			if (gm)
			{
				_MapDeco.setDisplayedInstance(getDisplayedInstance(), false);
				gm->addDeco(&_MapDeco);
				_MapDeco.invalidateCoords();
			}
		}
	}
	_Touched = true;
	_Active = active;
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:25,代码来源:displayer_visual_shape.cpp

示例4: update


//.........这里部分代码省略.........

		_TraversedPrimInfos.push_back(CTraversedPrimInfo());
		_TraversedPrimInfos.back().PrimDisplay = nextDV;
		_TraversedPrimInfos.back().Visible = nextDV->getActualDisplayMode() != DisplayModeHidden;


		CWorldPosCache wpc;
		wpc.DV = nextDV;
		wpc.WorldPos2f = nextDV->getWorldPos2f();
		_WPCache.push_back(wpc);

		if (nextDV->getActualDisplayMode() != DisplayModeHidden
			&& prevDV->getActualDisplayMode() != DisplayModeHidden)
		{
			// special case for regions
			if (nextZone->isKindOf("Region"))
			{
				// first case : previous zone is not a region
				if (!prevZone || !prevZone->isKindOf("Region"))
				{
					// search shortest distance bewteen last pos and the region
					CVector entryPos;
					if (nextDV->evalEnterPoint(prevDV->evalExitPoint(), entryPos))
					{
						addFootSteps(CLine(prevDV->evalExitPoint(), entryPos));
					}
					else
					{
						addWanderSteps(prevDV->evalExitPoint());
					}
				}
				else
				{
					// region-region footsteps
					// just use the couple of vertices for which the distance is the smallest
					static std::vector<CVector2f> r0;
					static std::vector<CVector2f> r1;
					prevDV->getSonsWorldPos2f(r0);
					nextDV->getSonsWorldPos2f(r1);
					if (!r0.empty() && !r1.empty())
					{
						CVector2f p0, p1;
						float bestDist = FLT_MAX;
						for(uint k = 0; k < r0.size(); ++k)
						{
							for(uint l = 0; l < r0.size(); ++l)
							{
								float dist = (r0[k] - r1[l]).norm();
								if (dist <bestDist)
								{
									bestDist = dist;
									p0 = r0[k];
									p1 = r1[l];
								}
							}
						}
						nlassert(bestDist != FLT_MAX);
						addFootSteps(CLine(p0.asVector(), p1.asVector()));
					}
				}
			}
			else
			{
				// special case if prev zone is a region
				if (prevZone && prevZone->isKindOf("Region"))
				{
					// search shortest distance bewteen last pos and the region
					CVector entryPos;
					if (prevDV->evalEnterPoint(nextDV->evalLinkPoint(), entryPos))
					{
						addFootSteps(CLine(entryPos, nextDV->evalLinkPoint()));
					}
					else
					{
						addWanderSteps(nextDV->evalLinkPoint());
					}
				}
				else
				{
					// simple footsteps between last & new pos
					addFootSteps(CLine(prevDV->evalExitPoint(), nextDV->evalLinkPoint()));
				}
			}
		}
		prevDV   = nextDV;
		prevZone = nextZone;
	}
	//
	CGroupMap *gm = CTool::getWorldMap();
	if (!_AddedToWorldMap && gm)
	{
		gm->addDeco(this);
	}
	if (_AddedToWorldMap)
	{
		setWorldMapNumEdges((uint)_FootSteps.size());
		nlassert(gm);
		onUpdate(*gm);
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:101,代码来源:displayer_visual_activity_sequence.cpp


注:本文中的CGroupMap::addDeco方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。