00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00017 #ifndef _FCD_CAMERA_H_
00018 #define _FCD_CAMERA_H_
00019
00020 #include "FCDocument/FCDTargetedEntity.h"
00021
00022 class FCDocument;
00023 class FCDSceneNode;
00024
00044 class FCOLLADA_EXPORT FCDCamera : public FCDTargetedEntity
00045 {
00046 private:
00047 DeclareObjectType;
00048
00049
00050 bool isPerspective;
00051 bool isOrthographic;
00052 bool hasHorizontalView;
00053 bool hasVerticalView;
00054
00055
00056 float viewY;
00057 float viewX;
00058 float nearZ;
00059 float farZ;
00060 float aspectRatio;
00061
00062
00063 bool hasAperture;
00064 float verticalAperture;
00065 float horizontalAperture;
00066 float lensSqueeze;
00067
00068 public:
00071 FCDCamera(FCDocument* document);
00072
00075 virtual ~FCDCamera();
00076
00079 virtual Type GetType() const { return CAMERA; }
00080
00084 inline bool IsPerspective() const { return isPerspective; }
00085
00087 inline void SetPerspective() { isPerspective = true; isOrthographic = false; }
00088
00093 inline bool HasHorizontalFov() const { return hasHorizontalView; }
00094
00099 inline bool HasVerticalFov() const { return hasVerticalView; }
00100
00105 inline float& GetFovX() { return viewX; }
00106 inline const float& GetFovX() const { return viewX; }
00112 inline float& GetFovY() { return viewY; }
00113 inline const float& GetFovY() const { return viewY; }
00117 void SetFovX(float fovX);
00118
00121 void SetFovY(float fovY);
00122
00125 inline bool IsOrthographic() const { return isOrthographic; }
00126
00128 inline void SetOrthographic() { isPerspective = false; isOrthographic = true; }
00129
00134 inline bool HasHorizontalMag() const { return hasHorizontalView; }
00135
00140 inline bool HasVerticalMag() const { return hasVerticalView; }
00141
00146 inline float& GetMagX() { return viewX; }
00147 inline const float& GetMagX() const { return viewX; }
00153 inline float& GetMagY() { return viewY; }
00154 inline const float& GetMagY() const { return viewY; }
00158 inline void SetMagX(float magX) { return SetFovX(magX); }
00159
00162 inline void SetMagY(float magY) { return SetFovY(magY); }
00163
00169 inline float& GetNearZ() { return nearZ; }
00170 inline const float& GetNearZ() const { return nearZ; }
00176 inline float& GetFarZ() { return farZ; }
00177 inline const float& GetFarZ() const { return farZ; }
00185 inline float& GetAspectRatio() { return aspectRatio; }
00186 inline const float& GetAspectRatio() const { return aspectRatio; }
00194 inline void SetNearZ(float _nearZ) { nearZ = _nearZ; }
00195
00201 inline void SetFarZ(float _farZ) { farZ = _farZ; }
00202
00205 void SetAspectRatio(float aspectRatio);
00206
00210 inline bool HasAperture() const { return hasAperture; }
00211
00215 inline float& GetVerticalAperture() { return verticalAperture; }
00216 inline const float& GetVerticalAperture() const { return verticalAperture; }
00221 inline float& GetHorizontalAperture() { return horizontalAperture; }
00222 inline const float& GetHorizontalAperture() const { return horizontalAperture; }
00229 inline float& GetLensSqueeze() { return lensSqueeze; }
00230 inline const float& GetLensSqueeze() const { return lensSqueeze; }
00234 inline void SetVerticalAperture(float aperture) { verticalAperture = aperture; hasAperture = true; }
00235
00238 inline void SetHorizontalAperture(float aperture) { horizontalAperture = aperture; hasAperture = true; }
00239
00242 inline void SetLensSqueeze(float factor) { lensSqueeze = factor; }
00243
00248 FUStatus LoadFromXML(xmlNode* cameraNode);
00249
00253 virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
00254 };
00255
00256 #endif // _FCD_CAMERA_H_
00257