FPPlayerEntity::FPPlayerEntity(RenderSystem* pRenderSystem)
{
	m_PointingEulerDir = Vector3( 0.0f, 0.0f, 0.0f );
	m_TimeSinceLastShot = 0.0f;
	m_ShotEntityId = 0;
	m_bMouseDragged = false;
	SetRenderSystem( pRenderSystem );

	// Set up flashlight
	m_pSpotlight = new SpotLight();
	m_pSpotlight->SetRadius( 100.0f );
	m_pSpotlight->SetIntensity( 20.0f );
	m_pSpotlight->SetColor( Vector3(1.0f,1.0f,0.8f) );
	m_pSpotlight->SetCone( Vector2( XM_PI/3.0f, XM_PI/3.0f ) );
	m_pSpotlight->SetCookie( m_pRenderSystem->LoadTexture2D( L"Media/spotlight.bmp" ) );
	m_pSpotlight->Transformation()->SetPosition( 0.0f, 0.0f, 0.0f );
	m_pSpotlight->PointTo( Vector3( 0.0f, 0.0f, 25.0f ), 0.0f );
	m_pSpotlight->SetRSMEnabled( false );
	//m_pSpotlight->disable();

	UINT width, height;
	RenderSystemConfig config = pRenderSystem->GetConfig();
	width = config.Width;
	height = config.Height;

	// Set up first person camera
	m_pCamera = new Camera3D();
	m_pCamera->SetPosition( Transformation()->GetPosition() );
	m_pCamera->SetLookAt( Vector3( 0.0f, 1.0f, 0.0f ) );
	m_pCamera->SetUpVector( Vector3( 0.0f, 0.0f, 1.0f ) );
	m_pCamera->SetProjection( XM_PI*0.35f, width / (float)height, 0.1f, 2000.0f );
	m_pCamera->Update( 0.0f );
}
Beispiel #2
0
void GameCommon::Init()
{
	RenderingSystem* renderSystem = new RenderingSystem();
	SetRenderSystem(renderSystem);
	RegisterSystem(renderSystem);
}