示例#1
0
//
// HumanView::HumanView - Chapter 10, page 272
//
HumanView::HumanView(shared_ptr<IRenderer> renderer)
{
	InitAudio(); 

	m_pProcessManager = GCC_NEW ProcessManager;

	m_PointerRadius = 1;	// we assume we are on a mouse enabled machine - if this were a tablet we should detect it here.
	m_ViewId = gc_InvalidGameViewId;

	// Added post press for move, new, and destroy actor events and others
	RegisterAllDelegates();
	m_BaseGameState = BGS_Initializing;		// what is the current game state

	if (renderer)
	{
		// Moved to the HumanView class post press
		m_pScene.reset(GCC_NEW ScreenElementScene(renderer));

		Frustum frustum;
		frustum.Init(GCC_PI/4.0f, 1.0f, 1.0f, 100.0f);
		m_pCamera.reset(GCC_NEW CameraNode(&Mat4x4::g_Identity, frustum));
		GCC_ASSERT(m_pScene && m_pCamera && _T("Out of memory"));

		m_pScene->VAddChild(INVALID_ACTOR_ID, m_pCamera);
		m_pScene->SetCamera(m_pCamera);
	}
}
HumanView::HumanView(shared_ptr<IRenderer> renderer)
{
	InitAudio();

	m_pProcessManager = CB_NEW ProcessManager;

	m_PointerRadius = 1;
	m_ViewId = CB_INVALID_GAMEVIEW_ID;

	RegisterAllDelegates();
	m_BaseGameState = BaseGameState::Initializing;

	if (renderer)
	{
		// create the scene graph and camera
		m_pScene.reset(CB_NEW ScreenElementScene(renderer));

		Frustrum frustrum;
		frustrum.Init(CB_PI / 4.0f, 1.0f, 1.0f, 100.0f);
		m_pCamera.reset(CB_NEW CameraNode(&Mat4x4::Identity, frustrum));
		CB_ASSERT(m_pScene && m_pCamera && L"Out of Memory");

		m_pScene->AddChild(INVALID_GAMEOBJECT_ID, m_pCamera);
		m_pScene->SetCamera(m_pCamera);
	}

	m_LastDraw = 0;
}
示例#3
0
HumanView::HumanView(IRenderer* renderer)
{
	m_pProcessManager = BE_NEW ProcessManager;
	m_pDebugManager = BE_NEW DebugManager;

	m_pKeyboardHandler = nullptr;
	m_pMouseHandler = nullptr;

	m_mouseRadius = 1;
	m_viewId = be_InvalidGameViewId;

	RegisterAllDelegates();
	m_coreGameState = CGS_Initializing;

	m_runFullSpeed = true;

	if (renderer)
	{
		m_pScene = BE_NEW ScreenElementScene(renderer);

		Frustum frustum;
		frustum.Init(BE_PI / 4.0f, 1.0f, 1.0f, 100.0f);
		m_pCamera = BE_NEW CameraNode(&Mat4x4::g_Identity, frustum);
		BE_ASSERTf(m_pScene && m_pCamera, "Out of Memory");

		m_pScene->VAddChild(INVALID_ACTOR_ID, m_pCamera);
		m_pScene->SetCamera(m_pCamera);
	}

	bool result;
	result = m_pDebugManager->Initialize(this);
	if (!result)
	{
		BE_ERROR("Failed to Initialze DebugManager");
	}
}
示例#4
0
//
// TeapotWarsLogic::TeapotWarsLogic
//
TeapotWarsLogic::TeapotWarsLogic()
{
	m_pPhysics.reset(CreateGamePhysics());
    RegisterAllDelegates();
}