24 #ifndef PXR_BASE_GF_CAMERA_H 25 #define PXR_BASE_GF_CAMERA_H 34 #include "pxr/base/gf/api.h" 38 PXR_NAMESPACE_OPEN_SCOPE
75 GF_API
static const double DEFAULT_VERTICAL_APERTURE;
82 float verticalAperture = DEFAULT_VERTICAL_APERTURE,
83 float horizontalApertureOffset = 0.0,
84 float verticalApertureOffset = 0.0,
85 float focalLength = 50.0,
87 const std::vector<GfVec4f> &clippingPlanes = std::vector<GfVec4f>(),
89 float focusDistance = 0.0);
148 float aspectRatio,
float orthographicSize,
FOVDirection direction);
158 const float focalLength = 50.0);
175 GF_API
void SetFStop(
const float val);
235 GF_API
bool operator!=(
const GfCamera& other)
const;
241 float _horizontalAperture;
242 float _verticalAperture;
243 float _horizontalApertureOffset;
244 float _verticalApertureOffset;
247 std::vector<GfVec4f> _clippingPlanes;
251 float _focusDistance;
254 PXR_NAMESPACE_CLOSE_SCOPE
256 #endif // PXR_BASE_GF_CAMERA_H GF_API float GetHorizontalApertureOffset() const
Returns the horizontal offset of the projector aperture in tenths of a world unit (e....
static GF_API const double APERTURE_UNIT
The unit for horizontal and vertical aperture is one tenth of the world unit.
GF_API void SetClippingPlanes(const std::vector< GfVec4f > &val)
Sets additional arbitrarily oriented clipping planes.
GF_API bool operator==(const GfCamera &other) const
Equality operator. true iff all parts match.
Object-based representation of a camera.
GF_API float GetFStop() const
Returns the lens aperture.
GF_API float GetFieldOfView(FOVDirection direction) const
Returns the horizontal or vertical field of view in degrees.
GF_API void SetOrthographicFromAspectRatioAndSize(float aspectRatio, float orthographicSize, FOVDirection direction)
Sets the frustum to be orthographic such that it has the given aspectRatio and such that the orthogra...
GF_API void SetFocusDistance(const float val)
Sets the focus distance in world units.
static GF_API const double DEFAULT_HORIZONTAL_APERTURE
Default horizontal and vertical aperture, based on a 35mm (non-anamorphic) projector aperture (0....
GF_API void SetProjection(const Projection &val)
Sets the projection type.
GF_API GfRange1f GetClippingRange() const
Returns the clipping range in world units.
GF_API GfMatrix4d GetTransform() const
Returns the transform of the filmback in world space.
GF_API GfFrustum GetFrustum() const
Returns the computed, world-space camera frustum.
static GF_API const double FOCAL_LENGTH_UNIT
The unit for focal length. Similar to APERTURE_UNIT.
GF_API void SetTransform(const GfMatrix4d &val)
Sets the transform of the filmback in world space to val.
GF_API float GetFocusDistance() const
Returns the focus distance in world units.
GF_API void SetFStop(const float val)
Sets the lens aperture, unitless.
FOVDirection
Direction used for Field of View or orthographic size.
GF_API void SetFromViewAndProjectionMatrix(const GfMatrix4d &viewMatrix, const GfMatrix4d &projMatix, const float focalLength=50.0)
Sets the camera from a view and projection matrix.
Stores a 4x4 matrix of double elements.
GF_API float GetVerticalAperture() const
Returns the height of the projector aperture in tenths of a world unit (e.g., mm if the world unit is...
GF_API float GetHorizontalAperture() const
Returns the width of the projector aperture in tenths of a world unit (e.g., mm if the world unit is ...
Basic type: View frustum.
GF_API Projection GetProjection() const
Returns the projection type.
GF_API const std::vector< GfVec4f > & GetClippingPlanes() const
Returns additional clipping planes.
GF_API float GetVerticalApertureOffset() const
Returns the vertical offset of the projector aperture in tenths of a world unit (e....
Basic type: 1-dimensional floating point range.
Projection
Projection type.
GF_API float GetAspectRatio() const
Returns the projector aperture aspect ratio.
GF_API void SetHorizontalApertureOffset(const float val)
Sets the horizontal offset of the projector aperture in tenths of a world unit (e....
GF_API void SetVerticalApertureOffset(const float val)
Sets the vertical offset of the projector aperture in tenths of a world unit (e.g....
GF_API void SetHorizontalAperture(const float val)
Sets the width of the projector aperture in tenths of a world unit (e.g., mm if the world unit is ass...
GF_API float GetFocalLength() const
Returns the focal length in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).
GF_API void SetVerticalAperture(const float val)
Sets the height of the projector aperture in tenths of a world unit (e.g., mm if the world unit is as...
GF_API void SetPerspectiveFromAspectRatioAndFieldOfView(float aspectRatio, float fieldOfView, FOVDirection direction, float horizontalAperture=DEFAULT_HORIZONTAL_APERTURE)
Sets the frustum to be projective with the given aspectRatio and horizontal, respectively,...
GF_API void SetFocalLength(const float val)
These are the values actually stored in the class and they correspond to measurements of an actual ph...
GF_API void SetClippingRange(const GfRange1f &val)
Sets the clipping range in world units.