00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013 #ifndef _FBXSDK_SCENE_GEOMETRY_CAMERA_H_
00014 #define _FBXSDK_SCENE_GEOMETRY_CAMERA_H_
00015
00016 #include <fbxsdk/fbxsdk_def.h>
00017
00018 #include <fbxsdk/core/base/fbxstring.h>
00019 #include <fbxsdk/core/math/fbxvector4.h>
00020 #include <fbxsdk/scene/geometry/fbxnodeattribute.h>
00021
00022 #include <fbxsdk/fbxsdk_nsbegin.h>
00023
00024 class FbxTexture;
00025
00034 class FBXSDK_DLL FbxCamera : public FbxNodeAttribute
00035 {
00036 FBXSDK_OBJECT_DECLARE(FbxCamera,FbxNodeAttribute);
00037
00038 public:
00040 virtual FbxNodeAttribute::EType GetAttributeType() const;
00041
00043 void Reset();
00044
00055 enum EProjectionType
00056 {
00057 ePerspective,
00058 eOrthogonal
00059 };
00060
00069 enum EFormat
00070 {
00071 eCustomFormat,
00072 eD1NTSC,
00073 eNTSC,
00074 ePAL,
00075 eD1PAL,
00076 eHD,
00077 e640x480,
00078 e320x200,
00079 e320x240,
00080 e128x128,
00081 eFullscreen
00082 };
00083
00090 void SetFormat(EFormat pFormat);
00091
00095 EFormat GetFormat() const;
00096
00100 enum EAspectRatioMode
00101 {
00102 eWindowSize,
00103 eFixedRatio,
00104 eFixedResolution,
00105 eFixedWidth,
00106 eFixedHeight
00107 };
00108
00116 void SetAspect(EAspectRatioMode pRatioMode, double pWidth, double pHeight);
00117
00121 EAspectRatioMode GetAspectRatioMode() const;
00122
00128 void SetPixelRatio(double pRatio);
00129
00133 double GetPixelRatio() const;
00134
00142 void SetNearPlane(double pDistance);
00143
00149 double GetNearPlane() const;
00150
00158 void SetFarPlane(double pDistance);
00159
00165 double GetFarPlane() const;
00166
00168
00179
00184 enum EApertureFormat
00185 {
00186 eCustomAperture,
00187 e16mmTheatrical,
00188 eSuper16mm,
00189 e35mmAcademy,
00190 e35mmTVProjection,
00191 e35mmFullAperture,
00192 e35mm185Projection,
00193 e35mmAnamorphic,
00194 e70mmProjection,
00195 eVistaVision,
00196 eDynaVision,
00197 eIMAX
00198 };
00199
00204 void SetApertureFormat(EApertureFormat pFormat);
00205
00209 EApertureFormat GetApertureFormat() const;
00210
00216 enum EApertureMode
00217 {
00218 eHorizAndVert,
00219 eHorizontal,
00220 eVertical,
00221 eFocalLength
00222 };
00223
00227 void SetApertureMode(EApertureMode pMode);
00228
00232 EApertureMode GetApertureMode() const;
00233
00239 void SetApertureWidth(double pWidth);
00240
00244 double GetApertureWidth() const;
00245
00251 void SetApertureHeight(double pHeight);
00252
00256 double GetApertureHeight() const;
00257
00263 void SetSqueezeRatio(double pRatio);
00264
00268 double GetSqueezeRatio() const;
00269
00278 enum EGateFit
00279 {
00280 eFitNone,
00281 eFitVertical,
00282 eFitHorizontal,
00283 eFitFill,
00284 eFitOverscan,
00285 eFitStretch
00286 };
00287
00293 double ComputeFieldOfView(double pFocalLength) const;
00294
00300 double ComputeFocalLength(double pAngleOfView) const;
00301
00304 enum EFilmRollOrder
00305 {
00306 eRotateFirst,
00307 eTranslateFirst
00308 };
00309
00311
00327
00334 void SetBackgroundFileName(const char* pFileName);
00335
00341 const char* GetBackgroundFileName() const;
00342
00349 void SetBackgroundMediaName(const char* pFileName);
00350
00356 const char* GetBackgroundMediaName() const;
00357
00364 void SetForegroundFileName(const char* pFileName);
00365
00371 const char* GetForegroundFileName() const;
00372
00379 void SetForegroundMediaName(const char* pFileName);
00380
00386 const char* GetForegroundMediaName() const;
00387
00388
00391 enum EPlateDrawingMode
00392 {
00393 ePlateBackground,
00394 ePlateForeground,
00395 ePlateBackAndFront
00396 };
00397
00402 void SetBackgroundAlphaTreshold(double pThreshold);
00403
00408 double GetBackgroundAlphaTreshold() const;
00409
00414 void SetBackPlateFitImage(bool pFitImage);
00415
00420 bool GetBackPlateFitImage() const;
00421
00427 void SetBackPlateCrop(bool pCrop);
00428
00434 bool GetBackPlateCrop() const;
00435
00440 void SetBackPlateCenter(bool pCenter);
00441
00446 bool GetBackPlateCenter() const;
00447
00453 void SetBackPlateKeepRatio(bool pKeepRatio);
00454
00460 bool GetBackPlateKeepRatio() const;
00461
00467 void SetShowFrontPlate(bool pEnable);
00468
00474 bool GetShowFrontPlate() const;
00475
00480 void SetFrontPlateFitImage(bool pFrontPlateFitImage);
00481
00486 bool GetFrontPlateFitImage() const;
00487
00493 void SetFrontPlateCrop(bool pFrontPlateCrop);
00494
00500 bool GetFrontPlateCrop() const;
00501
00506 void SetFrontPlateCenter(bool pFrontPlateCenter);
00507
00512 bool GetFrontPlateCenter() const;
00513
00519 void SetFrontPlateKeepRatio(bool pFrontPlateKeepRatio);
00520
00526 bool GetFrontPlateKeepRatio() const;
00527
00531 void SetForegroundOpacity(double pOpacity);
00532
00536 double GetForegroundOpacity() const;
00537
00541 void SetForegroundTexture(FbxTexture* pTexture);
00542
00546 FbxTexture* GetForegroundTexture() const;
00547
00551 enum EFrontBackPlaneDistanceMode
00552 {
00553 eRelativeToInterest,
00554 eRelativeToCamera
00555 };
00556
00560 void SetBackPlaneDistanceMode(EFrontBackPlaneDistanceMode pMode);
00561
00565 EFrontBackPlaneDistanceMode GetBackPlaneDistanceMode() const;
00566
00573 void SetFrontPlaneDistance(double pDistance);
00574
00578 double GetFrontPlaneDistance() const;
00579
00583 void SetFrontPlaneDistanceMode(EFrontBackPlaneDistanceMode pMode);
00584
00588 EFrontBackPlaneDistanceMode GetFrontPlaneDistanceMode() const;
00589
00592 enum EFrontBackPlaneDisplayMode
00593 {
00594 ePlanesDisabled,
00595 ePlanesAlways,
00596 ePlanesWhenMedia
00597 };
00598
00603 void SetViewFrustumFrontPlaneMode(EFrontBackPlaneDisplayMode pMode);
00604
00608 EFrontBackPlaneDisplayMode GetViewFrustumFrontPlaneMode() const;
00609
00614 void SetViewFrustumBackPlaneMode(EFrontBackPlaneDisplayMode pMode);
00615
00619 EFrontBackPlaneDisplayMode GetViewFrustumBackPlaneMode() const;
00620
00622
00629
00633 void SetViewCameraInterest(bool pEnable);
00634
00638 bool GetViewCameraInterest() const;
00639
00643 void SetViewNearFarPlanes(bool pEnable);
00644
00648 bool GetViewNearFarPlanes() const;
00649
00652 enum ESafeAreaStyle
00653 {
00654 eSafeAreaRound,
00655 eSafeAreaSquare
00656 };
00657
00659
00666
00669 enum ERenderOptionsUsageTime
00670 {
00671 eInteractive,
00672 eOnDemand
00673 };
00674
00677 enum EAntialiasingMethod
00678 {
00679 eAAOversampling,
00680 eAAHardware
00681 };
00682
00685 enum ESamplingType
00686 {
00687 eSamplingUniform,
00690 eSamplingStochastic
00692 };
00693
00697 enum EFocusDistanceSource
00698 {
00699 eFocusSrcCameraInterest,
00701 eFocusSpecificDistance
00702 };
00703
00705
00718 FbxVector4 EvaluatePosition(int& pIndex, const FbxTime& pTime=FBXSDK_TIME_ZERO) const;
00719
00728 FbxVector4 EvaluateLookAtPosition(int& pIndex, const FbxTime& pTime=FBXSDK_TIME_ZERO) const;
00729
00740 FbxVector4 EvaluateUpDirection(int& pIndex, const FbxVector4& pCameraPosition, const FbxVector4& pLookAtPosition, const FbxTime& pTime=FBXSDK_TIME_ZERO) const;
00741
00747 FbxMatrix ComputeProjectionMatrix(const int pWidth, const int pHeight) const;
00748
00755 FBX_DEPRECATED FbxVector4 ComputeUpVector(const FbxVector4& pCameraPosition, const FbxVector4& pLookAtPosition) const;
00756
00766 FBX_DEPRECATED FbxMatrix ComputePerspective(int pPixelWidth, int pPixelHeight, bool pIncludePostPerspective) const;
00767
00777 bool IsBoundingBoxInView(const FbxMatrix& pWorldToScreen, const FbxMatrix& pWorldToCamera, const FbxVector4 pPoints[8]) const;
00778
00787 bool IsPointInView(const FbxMatrix& pWorldToScreen, const FbxMatrix& pWorldToCamera, const FbxVector4& pPoint) const;
00788
00795 FbxMatrix ComputeWorldToScreen(int pPixelWidth, int pPixelHeight, const FbxAMatrix& pWorldToCamera) const;
00797
00799
00800
00801
00803
00804
00805
00806
00807
00815 FbxPropertyT<FbxDouble3> Position;
00816
00824 FbxPropertyT<FbxDouble3> UpVector;
00825
00837 FbxPropertyT<FbxDouble3> InterestPosition;
00838
00846 FbxPropertyT<FbxDouble> Roll;
00847
00857 FbxPropertyT<FbxDouble> OpticalCenterX;
00858
00868 FbxPropertyT<FbxDouble> OpticalCenterY;
00869
00877 FbxPropertyT<FbxDouble3> BackgroundColor;
00878
00888 FbxPropertyT<FbxDouble> TurnTable;
00889
00898 FbxPropertyT<FbxBool> DisplayTurnTableIcon;
00899
00900
00901
00902
00903
00912 FbxPropertyT<FbxBool> UseMotionBlur;
00913
00922 FbxPropertyT<FbxBool> UseRealTimeMotionBlur;
00923
00931 FbxPropertyT<FbxDouble> MotionBlurIntensity;
00932
00933
00934
00935
00936
00945 FbxPropertyT<EAspectRatioMode> AspectRatioMode;
00946
00954 FbxPropertyT<FbxDouble> AspectWidth;
00955
00963 FbxPropertyT<FbxDouble> AspectHeight;
00964
00973 FbxPropertyT<FbxDouble> PixelAspectRatio;
00974
00982 FbxPropertyT<EApertureMode> ApertureMode;
00983
00993 FbxPropertyT<EGateFit> GateFit;
00994
01006 FbxPropertyT<FbxDouble> FieldOfView;
01007
01019 FbxPropertyT<FbxDouble> FieldOfViewX;
01020
01032 FbxPropertyT<FbxDouble> FieldOfViewY;
01033
01041 FbxPropertyT<FbxDouble> FocalLength;
01042
01053 FbxPropertyT<EFormat> CameraFormat;
01054
01055
01056
01057
01058
01065 FbxPropertyT<FbxBool> UseFrameColor;
01066
01074 FbxPropertyT<FbxDouble3> FrameColor;
01075
01076
01077
01078
01079
01087 FbxPropertyT<FbxBool> ShowName;
01088
01096 FbxPropertyT<FbxBool> ShowInfoOnMoving;
01097
01105 FbxPropertyT<FbxBool> ShowGrid;
01106
01114 FbxPropertyT<FbxBool> ShowOpticalCenter;
01115
01126 FbxPropertyT<FbxBool> ShowAzimut;
01127
01135 FbxPropertyT<FbxBool> ShowTimeCode;
01136
01144 FbxPropertyT<FbxBool> ShowAudio;
01145
01153 FbxPropertyT<FbxDouble3> AudioColor;
01154
01155
01156
01157
01158
01167 FbxPropertyT<FbxDouble> NearPlane;
01168
01177 FbxPropertyT<FbxDouble> FarPlane;
01178
01187 FbxPropertyT<FbxBool> AutoComputeClipPlanes;
01188
01189
01190
01191
01192
01193
01203 FbxPropertyT<FbxDouble> FilmWidth;
01204
01214 FbxPropertyT<FbxDouble> FilmHeight;
01215
01224 FbxPropertyT<FbxDouble> FilmAspectRatio;
01225
01235 FbxPropertyT<FbxDouble> FilmSqueezeRatio;
01236
01245 FbxPropertyT<EApertureFormat> FilmFormat;
01246
01255 FbxPropertyT<FbxDouble> FilmOffsetX;
01256
01266 FbxPropertyT<FbxDouble> FilmOffsetY;
01267
01277 FbxPropertyT<FbxDouble> PreScale;
01278
01284 FbxPropertyT<FbxDouble> FilmTranslateX;
01285
01293 FbxPropertyT<FbxDouble> FilmTranslateY;
01294
01303 FbxPropertyT<FbxDouble> FilmRollPivotX;
01304
01313 FbxPropertyT<FbxDouble> FilmRollPivotY;
01314
01325 FbxPropertyT<FbxDouble> FilmRollValue;
01326
01336 FbxPropertyT<EFilmRollOrder> FilmRollOrder ;
01337
01338
01339
01340
01341
01350 FbxPropertyT<FbxBool> ViewCameraToLookAt;
01351
01359 FbxPropertyT<FbxBool> ViewFrustumNearFarPlane;
01360
01368 FbxPropertyT<EFrontBackPlaneDisplayMode> ViewFrustumBackPlaneMode;
01369
01377 FbxPropertyT<FbxDouble> BackPlaneDistance;
01378
01386 FbxPropertyT<EFrontBackPlaneDistanceMode> BackPlaneDistanceMode;
01387
01395 FbxPropertyT<EFrontBackPlaneDisplayMode> ViewFrustumFrontPlaneMode;
01396
01404 FbxPropertyT<FbxDouble> FrontPlaneDistance;
01405
01413 FbxPropertyT<EFrontBackPlaneDistanceMode> FrontPlaneDistanceMode;
01414
01415
01416
01417
01418
01426 FbxPropertyT<FbxBool> LockMode;
01427
01435 FbxPropertyT<FbxBool> LockInterestNavigation;
01436
01437
01438
01439
01440
01449 FbxPropertyT<FbxBool> BackPlateFitImage;
01450
01459 FbxPropertyT<FbxBool> BackPlateCrop;
01460
01469 FbxPropertyT<FbxBool> BackPlateCenter;
01470
01479 FbxPropertyT<FbxBool> BackPlateKeepRatio;
01480
01488 FbxPropertyT<FbxDouble> BackgroundAlphaTreshold;
01489
01497 FbxPropertyT<FbxDouble> BackPlaneOffsetX;
01498
01506 FbxPropertyT<FbxDouble> BackPlaneOffsetY;
01507
01515 FbxPropertyT<FbxDouble> BackPlaneRotation;
01516
01526 FbxPropertyT<FbxDouble> BackPlaneScaleX;
01527
01537 FbxPropertyT<FbxDouble> BackPlaneScaleY;
01538
01547 FbxPropertyT<FbxBool> ShowBackplate;
01548
01556 FbxPropertyT<FbxReference> BackgroundTexture;
01557
01558
01559
01560
01561
01562
01570 FbxPropertyT<FbxBool> FrontPlateFitImage;
01571
01579 FbxPropertyT<FbxBool> FrontPlateCrop;
01580
01588 FbxPropertyT<FbxBool> FrontPlateCenter;
01589
01597 FbxPropertyT<FbxBool> FrontPlateKeepRatio;
01598
01599
01608 FbxPropertyT<FbxBool> ShowFrontplate;
01609
01617 FbxPropertyT<FbxDouble> FrontPlaneOffsetX;
01618
01626 FbxPropertyT<FbxDouble> FrontPlaneOffsetY;
01627
01635 FbxPropertyT<FbxDouble> FrontPlaneRotation;
01636
01644 FbxPropertyT<FbxDouble> FrontPlaneScaleX;
01645
01653 FbxPropertyT<FbxDouble> FrontPlaneScaleY;
01654
01662 FbxPropertyT<FbxReference> ForegroundTexture;
01663
01671 FbxPropertyT<FbxDouble> ForegroundOpacity;
01672
01673
01674
01675
01676
01684 FbxPropertyT<FbxBool> DisplaySafeArea;
01685
01693 FbxPropertyT<FbxBool> DisplaySafeAreaOnRender;
01694
01702 FbxPropertyT<ESafeAreaStyle> SafeAreaDisplayStyle;
01703
01711 FbxPropertyT<FbxDouble> SafeAreaAspectRatio;
01712
01713
01714
01715
01716
01726 FbxPropertyT<FbxBool> Use2DMagnifierZoom;
01727
01735 FbxPropertyT<FbxDouble> _2DMagnifierZoom;
01736
01744 FbxPropertyT<FbxDouble> _2DMagnifierX;
01745
01753 FbxPropertyT<FbxDouble> _2DMagnifierY;
01754
01755
01756
01757
01758
01766 FbxPropertyT<EProjectionType> ProjectionType;
01767
01775 FbxPropertyT<FbxDouble> OrthoZoom;
01776
01777
01778
01779
01780
01788 FbxPropertyT<FbxBool> UseRealTimeDOFAndAA;
01789
01797 FbxPropertyT<FbxBool> UseDepthOfField;
01798
01807 FbxPropertyT<EFocusDistanceSource> FocusSource;
01808
01816 FbxPropertyT<FbxDouble> FocusAngle;
01817
01828 FbxPropertyT<FbxDouble> FocusDistance;
01829
01837 FbxPropertyT<FbxBool> UseAntialiasing;
01838
01846 FbxPropertyT<FbxDouble> AntialiasingIntensity;
01847
01855 FbxPropertyT<EAntialiasingMethod> AntialiasingMethod;
01856
01857
01858
01859
01860
01868 FbxPropertyT<FbxBool> UseAccumulationBuffer;
01869
01877 FbxPropertyT<FbxInt> FrameSamplingCount;
01878
01886 FbxPropertyT<ESamplingType> FrameSamplingType;
01887
01888
01889
01890
01891 #ifndef DOXYGEN_SHOULD_SKIP_THIS
01892 virtual FbxObject& Copy(const FbxObject& pObject);
01893
01894 protected:
01895 virtual void ConstructProperties(bool pForceSet);
01896 virtual bool PropertyNotify(FbxObject::EPropertyNotifyType pType, FbxProperty& pProperty);
01897 virtual FbxStringList GetTypeFlags() const;
01898
01899 private:
01900 double ComputePixelRatio(FbxUInt pWidth, FbxUInt pHeight, double pScreenRatio = 1.3333333333);
01901
01902
01903 FbxString mBackgroundMediaName;
01904 FbxString mBackgroundFileName;
01905
01906
01907 FbxString mForegroundMediaName;
01908 FbxString mForegroundFileName;
01909
01910
01911 int mUpSign;
01912 FbxVector4 mLastUp;
01913 friend class FbxCameraManipulator;
01914
01915 #endif
01916 };
01917
01918 inline EFbxType FbxTypeOf(const FbxCamera::EAntialiasingMethod&){ return eFbxEnum; }
01919 inline EFbxType FbxTypeOf(const FbxCamera::EApertureFormat&){ return eFbxEnum; }
01920 inline EFbxType FbxTypeOf(const FbxCamera::EApertureMode&){ return eFbxEnum; }
01921 inline EFbxType FbxTypeOf(const FbxCamera::EAspectRatioMode&){ return eFbxEnum; }
01922 inline EFbxType FbxTypeOf(const FbxCamera::EFrontBackPlaneDisplayMode&){ return eFbxEnum; }
01923 inline EFbxType FbxTypeOf(const FbxCamera::EFrontBackPlaneDistanceMode&){ return eFbxEnum; }
01924 inline EFbxType FbxTypeOf(const FbxCamera::EPlateDrawingMode&){ return eFbxEnum; }
01925 inline EFbxType FbxTypeOf(const FbxCamera::EFocusDistanceSource&){ return eFbxEnum; }
01926 inline EFbxType FbxTypeOf(const FbxCamera::EFormat&){ return eFbxEnum; }
01927 inline EFbxType FbxTypeOf(const FbxCamera::EGateFit&){ return eFbxEnum; }
01928 inline EFbxType FbxTypeOf(const FbxCamera::EProjectionType&){ return eFbxEnum; }
01929 inline EFbxType FbxTypeOf(const FbxCamera::ERenderOptionsUsageTime&){ return eFbxEnum; }
01930 inline EFbxType FbxTypeOf(const FbxCamera::ESafeAreaStyle&){ return eFbxEnum; }
01931 inline EFbxType FbxTypeOf(const FbxCamera::ESamplingType&){ return eFbxEnum; }
01932 inline EFbxType FbxTypeOf(const FbxCamera::EFilmRollOrder&){ return eFbxEnum; }
01933
01934 #include <fbxsdk/fbxsdk_nsend.h>
01935
01936 #endif