16 FLAG_CAM_LOOKAT = (1 << 0),
17 FLAG_CAM_ROTATE = (1 << 1),
18 FLAG_CAM_AIM = (1 << 2),
19 FLAG_CAM_MTX_READY = (1 << 3),
21 FLAG_PROJ_FRUSTUM = (1 << 4),
22 FLAG_PROJ_PERSP = (1 << 5),
23 FLAG_PROJ_ORTHO = (1 << 6),
24 FLAG_PROJ_MTX_READY = (1 << 7),
26 FLAG_VI_ODD_FIELD = (1 << 8),
37 GXProjectionType projType;
62class Camera :
public ResCommon<CameraData> {
64 enum PostureType { POSTURE_LOOKAT, POSTURE_ROTATE, POSTURE_AIM };
78 void Init(u16 efbWidth, u16 efbHeight, u16 xfbWidth, u16 xfbHeight,
79 u16 viWidth, u16 viHeight);
81 void SetPosition(f32 x, f32 y, f32 z);
86 void SetPerspective(f32 fovy, f32 aspect, f32 near, f32 far);
87 void SetOrtho(f32 top, f32 bottom, f32 left, f32 right, f32 near, f32 far);
88 void SetProjectionMtxDirectly(
const math::MTX44* pMtx);
90 void SetScissor(ulong x, ulong y, ulong width, ulong height);
91 void SetScissorBoxOffset(s32 ox, s32 oy);
93 void SetViewport(f32 x, f32 y, f32 width, f32 height);
94 void SetViewportZRange(f32 near, f32 far);
95 void GetViewport(f32* pX, f32* pY, f32* pWidth, f32* pHeight, f32* pNear,
101 void GetEnvironmentTexMtx(
math::MTX34* pMtx)
const;
103 void GXSetViewport()
const;
104 void GXSetProjection()
const;
105 void GXSetScissor()
const;
106 void GXSetScissorBoxOffset()
const;
108 GXProjectionType GetProjectionType()
const {
109 return ref().projType;
113 void UpdateCameraMtx()
const;
114 void UpdateProjectionMtx()
const;