3ds Max C++ API Reference
Loading...
Searching...
No Matches
Camera Class Reference

Represents the projection matrix and common properties of a perspective or orthographic camera. More...

#include <gfx.h>

+ Inheritance diagram for Camera:

Public Member Functions

DllExport Camera ()
 
void setPersp (float f, float asp)
 Initializes the camera with a perspective view given a field-of-view value and aspect ratio.
 
void setOrtho (float l, float t, float r, float b)
 Initializes the camera with a orthographic view.
 
void setClip (float h, float y)
 Sets the camera clipping hither and yon values.
 
CameraType getType (void)
 Returns the type of camera whether it is a perspective camera (PERSP_CAM) or orthographic camera (ORTHO_CAM)
 
float getHither (void)
 Returns the clipping hither value.
 
float getYon (void)
 Returns the clipping yon value.
 
DllExport void reset ()
 Resets the projection matrix.
 
DllExport void getProj (float mat[4][4])
 Returns the projection matrix.
 
- Public Member Functions inherited from BaseInterfaceServer
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

Detailed Description

Represents the projection matrix and common properties of a perspective or orthographic camera.

Constructor & Destructor Documentation

◆ Camera()

Member Function Documentation

◆ setPersp()

void setPersp ( float  f,
float  asp 
)
inline

Initializes the camera with a perspective view given a field-of-view value and aspect ratio.

120 { type = PERSP_CAM; persp.fov = f;
121 persp.aspect = asp; makeMatrix(); }
@ PERSP_CAM
Perspective view camera type.
Definition: GraphicsTypes.h:17

◆ setOrtho()

void setOrtho ( float  l,
float  t,
float  r,
float  b 
)
inline

Initializes the camera with a orthographic view.

125 { type = ORTHO_CAM; ortho.left = l; ortho.top = t;
126 ortho.right = r; ortho.bottom = b; makeMatrix(); }
@ ORTHO_CAM
Orthographic projection camera type.
Definition: GraphicsTypes.h:18
float float b
Definition: texutil.h:51

◆ setClip()

void setClip ( float  h,
float  y 
)
inline

Sets the camera clipping hither and yon values.

130 { hither = h; yon = y; makeMatrix(); }

◆ getType()

CameraType getType ( void  )
inline

Returns the type of camera whether it is a perspective camera (PERSP_CAM) or orthographic camera (ORTHO_CAM)

133{ return type; }

◆ getHither()

float getHither ( void  )
inline

Returns the clipping hither value.

136{ return hither; }

◆ getYon()

float getYon ( void  )
inline

Returns the clipping yon value.

139{ return yon; }

◆ reset()

DllExport void reset ( )

Resets the projection matrix.

◆ getProj()

DllExport void getProj ( float  mat[4][4])

Returns the projection matrix.

Member Data Documentation

◆ fov

float fov

◆ aspect

float aspect

◆ persp

persp

◆ left

float left

◆ right

float right

◆ bottom

float bottom

◆ top

float top

◆ ortho

ortho