Ejemplo n.º 1
0
void BaseGameLogic::VRemoveActor(ActorId aid)
{
	if (!m_bProxy)
	{
		if( NULL!=VGetActor(aid).get() )
		{
			m_pPhysics->VRemoveActor(aid);
			m_ActorList.erase(aid);
		}
		else
		{
			assert(0 && _T("Unknown actor!"));
		}
	}



	if( NULL!=VGetActor(aid).get() )
	{
		m_ActorList.erase(aid);
	}
	else
	{
		assert(0 && _T("Unknown actor!"));
	}


}
Ejemplo n.º 2
0
void BaseGameLogic::VMoveActor(const ActorId id, Mat4x4 const &mat)
{
	shared_ptr<IActor> pActor = VGetActor(id);
	if (pActor)
	{
		pActor->VSetMat(mat);
	}
}
Ejemplo n.º 3
0
void nxBaseGameLogic::VMoveActor(const nxActorId id, nxPoint3 pos, nxReal orientation)
{
	shared_ptr<nxIActor> actor = VGetActor(id);

	if(actor)
	{
		actor->VSetPos(pos);
		actor->VSetOrientation(orientation);
	}
}
Ejemplo n.º 4
0
void TeapotWarsLogic::EndSteerDelegate(IEventDataPtr pEventData)
{
    shared_ptr<EvtData_StartThrust> pCastEventData = static_pointer_cast<EvtData_StartThrust>(pEventData);
    StrongActorPtr pActor = MakeStrongPtr(VGetActor(pCastEventData->GetActorId()));
    if (pActor)
    {
        shared_ptr<PhysicsComponent> pPhysicalComponent = MakeStrongPtr(pActor->GetComponent<PhysicsComponent>(PhysicsComponent::g_Name));
        if (pPhysicalComponent)
        {
            pPhysicalComponent->RemoveAngularAcceleration();
        }
    }
}
Ejemplo n.º 5
0
//
// TeapotWarsBaseGame::VRemoveActor			- TODO
//
void CometConquestBaseGame::VRemoveActor(ActorId aid) 
{ 
	shared_ptr<IActor> actor = VGetActor( aid );
	assert(actor && "No such actor!");
	if (!actor)
	{
		return;
	}

	//Stuff about calling function when actor is destroyed

	BaseGameLogic::VRemoveActor(aid); 

	//Now remove the actor from the system.
	safeQueEvent( IEventDataPtr( GCC_NEW EvtData_Destroy_Actor( aid ) ) );
}
Ejemplo n.º 6
0
void nxBaseGameLogic::VRemoveActor(nxActorId aid)
{
	if (m_bProxy)
	{
		return;
	}

	if( NULL != VGetActor(aid).get() )
	{
		m_pPhysics->VRemoveActor(aid);
		m_ActorList.erase(aid);
	}
	else
	{
		assert(0 && "Unknown actor!");
	}
}
Ejemplo n.º 7
0
void TeapotWarsLogic::VMoveActor(const ActorId id, Mat4x4 const &mat)
{
    BaseGameLogic::VMoveActor(id, mat);

    // [rez] HACK: This will be removed whenever the gameplay update stuff is in.  This is meant to model the death
    // zone under the grid.

	// FUTURE WORK - This would make a great basis for a Trigger actor that ran a LUA script when other
	//               actors entered or left it!

    StrongActorPtr pActor = MakeStrongPtr(VGetActor(id));
    if (pActor)
    {
        shared_ptr<TransformComponent> pTransformComponent = MakeStrongPtr(pActor->GetComponent<TransformComponent>(TransformComponent::g_Name));
        if (pTransformComponent && pTransformComponent->GetPosition().y < -25)
        {
            shared_ptr<EvtData_Destroy_Actor> pDestroyActorEvent(GCC_NEW EvtData_Destroy_Actor(id));
            IEventManager::Get()->VQueueEvent(pDestroyActorEvent);
        }
    }
}