Exemplo n.º 1
0
VOID CObject_Bus::CreateRenderInterface(VOID)
{
	if(m_pBusData != NULL && m_pBusData->m_nModelID != INVALID_ID)
	{
		DBC_DEFINEHANDLE(s_pCharModelDBC, DBC_CHARACTER_MODEL)
		LPCSTR lpszModelFileName = NULL;
		const _DBC_CHARACTER_MODEL *pCharModel = (const _DBC_CHARACTER_MODEL*)(s_pCharModelDBC->Search_Index_EQU(m_pBusData->m_nModelID));
		if (pCharModel != NULL)
		{
			lpszModelFileName = pCharModel->m_pszModelName;
		}

		if (lpszModelFileName != NULL)
		{
			m_pRenderInterface = CGameProcedure::s_pGfxSystem->New_EntityObject(tEntityNode::ETYPE_ACTOR);
			m_pRenderInterface->SetData(GetID());

			m_pRenderInterface->Actor_SetFile(lpszModelFileName);

			setVisible(isVisible());

			m_pRenderInterface->SetRayQuery(FALSE);

			BOOL bEnable = (isVisible() && CGameProcedure::s_pVariableSystem->GetAs_Int("View_HumanLightmap") == 1);
			if(bEnable)
			{
				m_pRenderInterface->Attach_ProjTexture(tEntityNode::SHADOW_BLOB, GetShadowRange());
			}

			m_pRenderInterface->SetAnimationEndEvent( (FUNC_ONANIMATIONENDEX)(CObject_Bus::_OnAnimationEnd), (DWORD)GetID() ,0);

			UpdatePassengerAttached();

			UpdateCharActionSetFile();

			SetPosition(GetPosition());
			SetFaceDir( GetFaceDir() );
			setVisible(isVisible());
		}
	}
}
Exemplo n.º 2
0
VOID CObject_Character::CreateRenderInterface(VOID)
{
	if(!m_pRenderInterface) return;

	//在渲染层刷新位置
	SetPosition(GetPosition());
	Enable(OSF_VISIABLE);

	//根据是否是FakeObject作一定处理
	if(GetFakeObjectFlag())
	{
		//禁止鼠标选择
		m_pRenderInterface->SetRayQuery(FALSE); 
		//设置特殊的VisibleFlag
		m_pRenderInterface->Actor_SetUIVisibleFlag();
	}
	else
	{
		m_pRenderInterface->Attach_ProjTexture(tEntityNode::SHADOW_BLOB, TRUE, GetShadowRange());

		//设置选择优先级
		if(CT_PLAYERMYSELF == GetCharacterType()) 
			m_pRenderInterface->RayQuery_SetLevel(tEntityNode::RL_PLAYERMYSLEF);
		else if(CT_PLAYEROTHER == GetCharacterType()) 
			m_pRenderInterface->RayQuery_SetLevel(tEntityNode::RL_PLAYEROTHER);
		else if(NPC_TYPE_PET == ((CObject_PlayerNPC*)this)->GetNpcType())
			m_pRenderInterface->RayQuery_SetLevel(tEntityNode::RL_PET);
		else
			m_pRenderInterface->RayQuery_SetLevel(tEntityNode::RL_CREATURE);
	}

	//设置骨骼动画回调
	m_pRenderInterface->SetAnimationEndEvent( (FUNC_ONANIMATIONEND)(CObject_Character::_OnAnimationEnd), (DWORD)GetID() );
	m_pRenderInterface->SetAnimationCanBreakEvent( (FUNC_ONANIMATIONEND)(CObject_Character::_OnAnimationCanBreak), (DWORD)GetID() );
	m_pRenderInterface->SetAnimationHitEvent( (FUNC_ONANIMATIONEND)(CObject_Character::_OnAnimationHit), (DWORD)GetID() );
	m_pRenderInterface->SetAnimationShakeEvent( (FUNC_ONANIMATIONEND)(CObject_Character::_OnAnimationShakeEvent), (DWORD)GetID() );
}