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


C++ IEntity::GetLocalEntityAABB方法代码示例

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


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

示例1: PostRender

	virtual void PostRender() override
	{
		IRenderer* pRenderer	= GLOBAL::Engine()->Renderer();
		eTRANSFORM_MODE mode	= GLOBAL::SelectionMgr()->GetTransformMode();

		int FPS = GLOBAL::Engine()->GlobalTimer()->GetFPS();

		RENDER_TEXT_QUAD textFPS;
		_itow_s(FPS, textFPS.strMsg, 5, 10);
		textFPS.rc.left = 0;
		textFPS.rc.top = 0;
		textFPS.rc.right = 100;
		textFPS.rc.bottom = 100;
		textFPS.clr = CColor( 1.0f, 1.0f, 1.0f, 1.0f );

		pRenderer->RenderText(&textFPS);
		pRenderer->RenderWorldGrid( XMMatrixIdentity(), 5000, 100 );

		TYPE_SELECTED_ENTITIES*	selcetedEntities =	GLOBAL::SelectionMgr()->List();

		for( UINT i=0; i< selcetedEntities->size() ; ++i)
		{
			IEntity* pEntity = (*selcetedEntities)[i];

			// Draw transform helper
			CQuat rot;
			XMMATRIX tm  = XMMatrixIdentity();
			tm.r[3] = pEntity->GetWorldTM().r[3];

			if( mode == TRANSFORM_MOVE) 
			{
				pRenderer->RenderMover( tm );
			}
			else if( mode == TRANSFORM_ROTATE) 
			{
				pRenderer->RenderRotator( tm);
			}
			else if( mode == TRANSFORM_SCALE)
			{
				pRenderer->RenderScaler( tm );
			}

			pRenderer->RenderAxis( pEntity->GetWorldTM() );

			const CAABB* pWorldAABB = pEntity->GetWorldAABB();

			// Draw Bounding Box
			if( pWorldAABB->IsValid() )
			{
				pRenderer->RenderBox( XMMatrixIdentity(), pWorldAABB->GetMin(), pWorldAABB->GetMax() ,COLOR_GRAY );

				const CAABB* pLocalEntityAABB = pEntity->GetLocalEntityAABB();
				if( pLocalEntityAABB->IsValid() )
					pRenderer->RenderBox( pEntity->GetWorldTM(), pLocalEntityAABB->GetMin(), pLocalEntityAABB->GetMax() ,COLOR_WHITE );
			}

			// Draw skeleton if it has a actor
			IEntityProxyActor* pActor = (IEntityProxyActor*)pEntity->GetProxy(ENTITY_PROXY_ACTOR);
			if( pActor != NULL)
			{
				JOINT_ENTITY_LIST* pJointEntitesList = pActor->GetJointEntities();
				CVertexPC buff[512];

				int vertIndex = 0;
				for( UINT i=1; i < pJointEntitesList->size(); ++i)
				{
					buff[vertIndex].vPos = (*pJointEntitesList)[i]->GetWorldPos();
					buff[vertIndex].color = COLOR_RED;
					vertIndex++;
					buff[vertIndex].vPos = (*pJointEntitesList)[i]->GetParent()->GetWorldPos();
					buff[vertIndex].color = COLOR_RED;
					vertIndex++;
				}

				pRenderer->RenderLine( buff, vertIndex );
			}
		}

		{
			/*
			const LIGHT_LIST* pLightList = GLOBAL::Engine()->LightMgr()->GetVisibleLights();
			for( UINT i =0; i < pLightList->size(); ++i )
			{
				CLightDesc* pLightDesc = (*pLightList)[i];
				pRenderer->RenderSphere( &pLightDesc->pos, pLightDesc->range );
			}*/
		}
	}
开发者ID:junsun2h,项目名称:tigerjk0409,代码行数:88,代码来源:S3DViewPanel.cpp


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