Ejemplo n.º 1
0
 void ActorProcess::VOnInit(void)
 {
     if(m_actor)
     {
         ADD_EVENT_LISTENER(this, &ActorProcess::ActorCreatedDelegate, CM_EVENT_ACTOR_CREATED);
         ADD_EVENT_LISTENER(this, &ActorProcess::DeleteActorDelegate, CM_EVENT_DELETE_ACTOR);
     }
 }
Ejemplo n.º 2
0
    ActorRealtimeProcess::ActorRealtimeProcess(IActor* actor) : m_actor(actor), m_event(NULL)
    {

        ADD_EVENT_LISTENER(this, &ActorRealtimeProcess::ActorCreatedDelegate, CM_EVENT_ACTOR_CREATED);
        ADD_EVENT_LISTENER(this, &ActorRealtimeProcess::DeleteActorDelegate, CM_EVENT_DELETE_ACTOR);
    
        m_event = CreateEvent(NULL, false, false, NULL);
    }
Ejemplo n.º 3
0
    CascadedShadowMapper::CascadedShadowMapper(UCHAR cascades) 
        : m_cascades(cascades), m_ppTargets(NULL), /*m_camera(1024, 1024, 0.01, 1000),*/ m_pCascadesSettings(NULL), m_ppBlurChain(NULL)
    {

        /*
#ifdef CSM_DEBUG
        for(USHORT i = 0; i < m_cascades; ++i)
        {
            m_cascadeCameraActor[i] = chimera::g_pApp->GetLogic()->VCreateActor("staticcamera.xml");
            std::stringstream ss;
            ss << "cascadeCam";
            ss << i;
            m_cascadeCameraActor[i]->SetName(ss.str());
        }
#endif
        */
        m_intensity = util::Vec3(1,1,1);

        m_ambient = util::Vec3(0.1f, 0.1f, 0.1f);

        std::unique_ptr<ActorDescription> desc = CmGetApp()->VGetLogic()->VGetActorFactory()->VCreateActorDescription();
        CameraComponent* cc = desc->AddComponent<CameraComponent>(CM_CMP_CAMERA);
        cc->SetCamera(std::shared_ptr<ICamera>(new util::FPSCamera(1,1,1e-2f,1e3)));
        TransformComponent* tc = desc->AddComponent<TransformComponent>(CM_CMP_TRANSFORM);

        m_lightActorCamera = CmGetApp()->VGetLogic()->VCreateActor(std::move(desc));

        //util::Vec3 lightPos(1.0f,1.3f,0.6f);
        util::Vec3 lightPos(1.0f, 0.2, 0);
        lightPos.Normalize();
        lightPos.Scale(util::Vec3(1000.0f, 1000.0f, 1000.0f));
        tc->GetTransformation()->SetTranslation(lightPos.x, lightPos.y, lightPos.z);
        cc->GetCamera()->MoveToPosition(tc->GetTransformation()->GetTranslation());
        m_lightActorCamera->SetName("cascadeLightCamera");

        /*
        m_viewActor = chimera::g_pApp->GetLogic()->VCreateActor("rendercamera.xml");
        m_viewActor->SetName("cascadeViewCamera");
        m_viewActor->GetComponent<chimera::TransformComponent>(chimera::TransformComponent::COMPONENT_ID).lock()->GetTransformation()->SetTranslate(0,5,-5);
        m_viewActor->GetComponent<chimera::CameraComponent>(chimera::CameraComponent::COMPONENT_ID).lock()->GetCamera()->MoveToPosition(
            m_viewActor->GetComponent<chimera::TransformComponent>(chimera::TransformComponent::COMPONENT_ID).lock()->GetTransformation()->GetTranslation());

        */
        ADD_EVENT_LISTENER(this, &CascadedShadowMapper::SetSunPositionDelegate, CM_EVENT_SET_SUN_POSITION);
        ADD_EVENT_LISTENER(this, &CascadedShadowMapper::SetSunIntensityDelegate, CM_EVENT_SET_SUN_INTENSITY);
        ADD_EVENT_LISTENER(this, &CascadedShadowMapper::SetSunAmbientDelegate, CM_EVENT_SET_SUN_AMBIENT);
    }
Ejemplo n.º 4
0
void FightMediator::startEventListen()
{
	ADD_EVENT_LISTENER(OnEvent_FightOpen,NULL,this,FightEvent::FIGHTVIEW_OPEN,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_FightClose,NULL,this,FightEvent::FIGHTVIEW_CLOSE,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_NextTurn,NULL,this,FightEvent::FIGHTVIEW_TURNOVER,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_AddPlayer,NULL,this,FightEvent::FIGHTVIEW_ADDPLAYER,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_GameStart,NULL,this,FightEvent::FIGHTVIEW_GAMESTART,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_UseSkillOrTools,NULL,this,FightEvent::FIGHTVIEW_USESOULSKILL,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_UseSkillOrTools,NULL,this,FightEvent::FIGHTVIEW_USETOOLS,FightMediator);
	ADD_EVENT_LISTENER(OnEvent_NotifyNextPlayerAct,NULL,this,FightEvent::FIGHTVIEW_NEXTPLAYER,FightMediator);
}
Ejemplo n.º 5
0
 ActorPicker::ActorPicker(void)  : m_currentActor(CM_INVALID_ACTOR_ID), m_created(FALSE), m_pTexture(NULL), m_pShaderProgram(NULL), m_pRenderTarget(NULL)
 {
     ADD_EVENT_LISTENER(this, &ActorPicker::PickActorDelegate, CM_EVENT_PICK_ACTOR);
     ADD_EVENT_LISTENER(this, &ActorPicker::ActorDeletedDelegate, CM_EVENT_ACTOR_DELETED);
 }
Ejemplo n.º 6
0
 ResourceCache::ResourceCache(void) : m_defaultDecompressor(NULL), m_defaultLoader(NULL), m_currentCacheSize(NULL)
 {
     ADD_EVENT_LISTENER(this, &ResourceCache::OnResourceChanged, CM_EVENT_RESOURCE_CHANGED);
 }