Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

camera.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------- //
00002 //
00003 // MODULE  : camera.h
00004 //
00005 // PURPOSE : CCamera - Definition
00006 //
00007 // CREATED : 12/20/00
00008 //
00009 // (c) 2000 LithTech, Inc.  All Rights Reserved
00010 //
00011 // ----------------------------------------------------------------------- //
00012 
00013 #ifndef __CAMERA_H__
00014 #define __CAMERA_H__
00015 
00016 // includes
00017 #include "i_event_callback.h"
00018 
00019 // Engine includes
00020 #include <ltbasedefs.h>
00021 
00022 
00024 enum ECameraState
00025 {
00026     CAMS_FIRST_PERSON = 0,
00027     CAMS_THIRD_PERSON,
00028 
00029     CAMS_NUM_STATES
00030 };
00031 
00032 enum ECameraViewportType
00033 {
00034     CAMV_FULLSCREEN = 0,
00035     CAMV_HORIZONTAL_TOP,
00036     CAMV_HORIZONTAL_BOTTOM,
00037     CAMV_VERTICAL_LEFT,
00038     CAMV_VERTICAL_RIGHT,
00039     CAMV_QUARTER_TOPLEFT,
00040     CAMV_QUARTER_TOPRIGHT,
00041     CAMV_QUARTER_BOTTOMLEFT,
00042     CAMV_QUARTER_BOTTOMRIGHT,
00043 };
00044 
00046 class CCamera : public IEventCallback
00047 {
00048   public:
00049     // Construction / destruction
00050     CCamera();
00051     virtual ~CCamera();
00052 
00053     void            Init(ECameraViewportType eType = CAMV_FULLSCREEN);
00054     void            Term();
00055     LTRESULT        CreateCamera();
00056 
00057     void            OnCommandOn(int32 command, uint32 nActCmd);
00058     void            OnCommandOff(int32 command, uint32 nActCmd);
00059 
00060     LTRESULT        Update(float fFrameTime);
00061     LTRESULT        PhysicsUpdate(float fFrameTime);
00062     virtual void    Event(uint32 nEvent, float fFrameTime, float fGameTime,
00063                         IEventData *pEventData, uint32 nPriority, 
00064                         ECallbackType eCT,
00065                         uint32 nCountRemaining, float fTimeRemaining, 
00066                         float fLoopTime);
00067     
00068 
00069     HLOCALOBJ       GetCameraHandle()               { return m_hCamera; }
00070 
00071     void            SetRotation(LTOrientation oRot);
00072     LTOrientation   GetRotation();
00073     LTVector3f      GetPosition();
00074     
00075     void            SetState(ECameraState state)    { m_eState = state; }
00076     uint32          GetState()                      { return m_eState; }
00077     void            CycleState();
00078     
00079     void            SetCameraViewport(uint32 nPosition);
00080     
00081     LTRESULT        HandleInput();
00082     void            AdjustCamera();
00083     
00084     LTRESULT        Render();
00085     
00086     void            SetSyncObject(HLOCALOBJ hObject) {m_hSyncObject = hObject;};
00087     HLOCALOBJ       GetSyncObject() {return m_hSyncObject;};
00088     void            SetSyncRotation(bool bSR = true) {m_bSyncRotation = bSR;};
00089     bool            GetSyncRotation() {return m_bSyncRotation;};
00090     
00091   protected:
00092     HLOCALOBJ       m_hCamera;  // Handle to engine object
00093     uint32          m_eState;   // Camera state (one of ECameraState)
00094 
00095       HLOCALOBJ     m_hSyncObject;
00096       bool          m_bSyncRotation;
00097 };
00098 
00099 
00100 #endif  // __CAMERA_H__

Generated on Mon Mar 4 08:42:23 2002 for Aria by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002