raSystem  1.0 bata
raLight.cpp
Go to the documentation of this file.
1 #include "..\include\raMain.h"
2 
3 namespace System
4 {
5 raLight::raLight(void) : m_Position(-10.0f, 2.0f, 0.0f),
6  m_Direction(1.0f, 0.0f, 0.0f),
7  m_DiffuseColor(0.9f),
8  m_AmbientColor(0.1f),
9  m_Attenuation(0, 0, 0.4f, 0)
10 {
11  m_cosHalfPhi = 0.4f;
12  m_cosHalfTheta = 0.9f;
13 }
14 
16 {
17 }
19 {
20  raVector3 vUp = raVector3(0.0f, 1.0f, 0.0f);
21  raVector3 eye = m_Position;
22  raVector3 lookAt = m_Position + m_Direction;
23 
24  raMatrix Out;
25  D3DXMatrixLookAtLH((D3DXMATRIX*)&Out, (D3DXVECTOR3*)&eye, (D3DXVECTOR3*)&lookAt,
26  (D3DXVECTOR3*)&vUp);
27 
28  return Out;
29 }
31 {
32  return m_mProj;
33 }
34 
35 void raLight::SetProjParams(float fFov, float fAspect, float fNearPlane, float fFarPlane)
36 {
37  m_fFOV = fFov;
38  m_fAspect = fAspect;
39  m_fNearPlane = fNearPlane;
40  m_fFarPlane = fFarPlane;
41 
42  D3DXMatrixPerspectiveFovLH((D3DXMATRIX*)&m_mProj, fFov, fAspect, fNearPlane, fFarPlane);
43 }
44 };
raMatrix GetViewMatrix() const
Definition: raLight.cpp:18
virtual void SetProjParams(float fFov, float fAspect, float fNearPlane, float fFarPlane)
Definition: raLight.cpp:35
raMatrix GetProjectionMatrix() const
Definition: raLight.cpp:30
raLight()
Definition: raLight.cpp:5
raVector3 m_Position
Definition: raLight.h:10
raVector3 m_Direction
Definition: raLight.h:11
float m_cosHalfPhi
Definition: raLight.h:19
float m_cosHalfTheta
Definition: raLight.h:20
~raLight()
Definition: raLight.cpp:15