7#ifndef PXR_BASE_GF_CAMERA_H
8#define PXR_BASE_GF_CAMERA_H
17#include "pxr/base/gf/api.h"
21PXR_NAMESPACE_OPEN_SCOPE
58 GF_API
static const double DEFAULT_VERTICAL_APERTURE;
65 float verticalAperture = DEFAULT_VERTICAL_APERTURE,
66 float horizontalApertureOffset = 0.0,
67 float verticalApertureOffset = 0.0,
68 float focalLength = 50.0,
70 const std::vector<GfVec4f> &clippingPlanes = std::vector<GfVec4f>(),
72 float focusDistance = 0.0);
131 float aspectRatio,
float orthographicSize,
FOVDirection direction);
141 const float focalLength = 50.0);
218 GF_API
bool operator!=(
const GfCamera& other)
const;
224 float _horizontalAperture;
225 float _verticalAperture;
226 float _horizontalApertureOffset;
227 float _verticalApertureOffset;
230 std::vector<GfVec4f> _clippingPlanes;
234 float _focusDistance;
237PXR_NAMESPACE_CLOSE_SCOPE
Object-based representation of a camera.
GF_API void SetClippingRange(const GfRange1f &val)
Sets the clipping range in world units.
static GF_API const double APERTURE_UNIT
The unit for horizontal and vertical aperture is one tenth of the world unit.
static GF_API const double FOCAL_LENGTH_UNIT
The unit for focal length. Similar to APERTURE_UNIT.
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 GfMatrix4d GetTransform() const
Returns the transform of the filmback in world space.
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 SetClippingPlanes(const std::vector< GfVec4f > &val)
Sets additional arbitrarily oriented clipping planes.
GF_API float GetVerticalApertureOffset() const
Returns the vertical offset of the projector aperture in tenths of a world unit (e....
GF_API void SetFStop(const float val)
Sets the lens aperture, unitless.
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 float GetAspectRatio() const
Returns the projector aperture aspect ratio.
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 float GetHorizontalAperture() const
Returns the width of the projector aperture in tenths of a world unit (e.g., mm if the world unit is ...
GF_API Projection GetProjection() const
Returns the projection type.
GF_API float GetFieldOfView(FOVDirection direction) const
Returns the horizontal or vertical field of view in degrees.
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 GetHorizontalApertureOffset() const
Returns the horizontal offset of the projector aperture in tenths of a world unit (e....
GF_API float GetFStop() const
Returns the lens aperture.
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 bool operator==(const GfCamera &other) const
Equality operator. true iff all parts match.
GF_API GfRange1f GetClippingRange() const
Returns the clipping range in world units.
Projection
Projection type.
GF_API GfFrustum GetFrustum() const
Returns the computed, world-space camera frustum.
GF_API void SetFromViewAndProjectionMatrix(const GfMatrix4d &viewMatrix, const GfMatrix4d &projMatix, const float focalLength=50.0)
Sets the camera from a view and projection matrix.
GF_API void SetProjection(const Projection &val)
Sets the projection type.
GF_API const std::vector< GfVec4f > & GetClippingPlanes() const
Returns additional clipping planes.
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 SetFocusDistance(const float val)
Sets the focus distance in world units.
GF_API void SetHorizontalApertureOffset(const float val)
Sets the horizontal offset of the projector aperture in tenths of a world unit (e....
FOVDirection
Direction used for Field of View or orthographic size.
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 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,...
static GF_API const double DEFAULT_HORIZONTAL_APERTURE
Default horizontal and vertical aperture, based on a 35mm (non-anamorphic) projector aperture (0....
Basic type: View frustum.
Stores a 4x4 matrix of double elements.
Basic type: 1-dimensional floating point range.