Public Member Functions

CameraObject Class Reference

This reference page is linked to from the following overview topics: Object Plug-ins, Lesson 2: The Scene Graph and Nodes, Overview: Scene Graph and Nodes, Deformable Objects, Cameras.


Search for all occurrences

Detailed Description

This is a base class from which camera plug-ins may be derived.

Methods of this class are used to get and set properties of the camera. All methods of this class are virtual. To ensure that the camera has a valid targDist during network rendering, be sure to call UpdateTargDistance( TimeValue t, INode* inode ); This call should be made PRIOR to cameraObj->EvalWorldState().

See also:
Class Object

#include <object.h>

Inheritance diagram for CameraObject:
Inheritance graph
[legend]

List of all members.

Public Member Functions

SClass_ID  SuperClassID ()
  Retrieves a constant representing the type of the plugin.
int  IsRenderable ()
  Indicates whether the object may be rendered.
virtual void  InitNodeName (MSTR &s)
  This is the default name of the node when it is created.
virtual int  UsesWireColor ()
  This method determines if the object color is used for display.
virtual RefResult  EvalCameraState (TimeValue time, Interval &valid, CameraState *cs)=0
  This method is called to update the CameraState and validity interval at the specified time.
virtual void  SetOrtho (BOOL b)=0
  Sets whether the camera is on ortho mode or not.
virtual BOOL  IsOrtho ()=0
  Returns TRUE if the camera is in ortho mode and FALSE if it is not.
virtual void  SetFOV (TimeValue t, float f)=0
  Sets the field-of-view of the camera at the specified time.
virtual float  GetFOV (TimeValue t, Interval &valid=Interval(0, 0))=0
  Returns the field-of-view setting of the camera at the specified time and adjusts the validity interval of the camera at this time to reflect the field-of-view parameter.
virtual void  SetTDist (TimeValue t, float f)=0
  Sets the target distance setting (for free cameras) at the specified time.
virtual float  GetTDist (TimeValue t, Interval &valid=Interval(0, 0))=0
  Returns the target distance setting of the camera at the specified time and adjusts the validity interval of the camera to reflect the target distance parameter.
virtual int  GetManualClip ()=0
  Returns the manual clip flag.
virtual void  SetManualClip (int onOff)=0
  Sets the manual clip flag.
virtual float  GetClipDist (TimeValue t, int which, Interval &valid=Interval(0, 0))=0
  Retrieves the clipping distance of the specified plane at the specified time and modifies the validity interval to reflect the setting of the clipping distance parameter.
virtual void  SetClipDist (TimeValue t, int which, float val)=0
  Sets the clipping distance of the specified plane at the specified time.
virtual void  SetEnvRange (TimeValue time, int which, float f)=0
  Sets the environment range distance at the specified time.
virtual float  GetEnvRange (TimeValue t, int which, Interval &valid=Interval(0, 0))=0
  Retrieves the environment range distance at the specified time and intersects the specified validity interval with the interval of the environment range parameter.
virtual void  SetEnvDisplay (BOOL b, int notify=TRUE)=0
  Sets the environment range display flag.
virtual BOOL  GetEnvDisplay (void)=0
  Retrieves the environment range display setting.
virtual void  RenderApertureChanged (TimeValue t)=0
  This method is called on all cameras when the render aperture width has changed.
virtual void  UpdateTargDistance (TimeValue t, INode *inode)
  This method is called on all target cameras when the target distance has changed.
virtual void  SetMultiPassEffectEnabled (TimeValue t, BOOL enabled)
  Enables or disables the multi-pass effect.
virtual BOOL  GetMultiPassEffectEnabled (TimeValue t, Interval &valid)
  Returns the enabled or disabled state of the multi-pass effect setting for the camera.
virtual void  SetMPEffect_REffectPerPass (BOOL enabled)
virtual BOOL  GetMPEffect_REffectPerPass ()
virtual void  SetIMultiPassCameraEffect (IMultiPassCameraEffect *pIMultiPassCameraEffect)
  The IMultiPassCameraEffect should be checked to see if compatible with the camera before being assigned.
virtual IMultiPassCameraEffect GetIMultiPassCameraEffect ()
  Returns a pointer to the current multi-pass camera effect.

Member Function Documentation

SClass_ID SuperClassID ( ) [inline, virtual]

Retrieves a constant representing the type of the plugin.

Returns:
A super class id that uniquely identifies the type (category) of the plugin. Note that several plugin classes can be of the same type, thus return the same super class id. Plugins are uniquely identified by their class ids. List of Super Class IDs.
See also:
SClass_ID

Reimplemented from ReferenceTarget.

{ return CAMERA_CLASS_ID; }
int IsRenderable ( ) [inline, virtual]

Indicates whether the object may be rendered.

Some objects such as construction grids and helpers should not be rendered and can return zero.

Returns:
Nonzero if the object may be rendered; otherwise 0.

Implements Object.

{ return(0);}
virtual void InitNodeName ( MSTR s ) [inline, virtual]

This is the default name of the node when it is created.

Parameters:
s The default name of the node is stored here.

Implements Object.

Reimplemented in MSPluginObject< GenCamera >, and MSObjectXtnd< GenCamera, MSPluginCamera >.

{ s = _M("Camera"); }
virtual int UsesWireColor ( ) [inline, virtual]

This method determines if the object color is used for display.

Returns:
TRUE if the object color is used for display; otherwise FALSE.

Reimplemented from Object.

Reimplemented in MSPluginCamera, and MSCameraXtnd.

{ return FALSE; } // TRUE if the object color is used for display
virtual RefResult EvalCameraState ( TimeValue  time,
Interval valid,
CameraState cs 
) [pure virtual]

This method is called to update the CameraState and validity interval at the specified time.

Parameters:
time Specifies the time to evaluate the camera.
valid The plug-in computes the validity interval of the camera at the specified time and stores the result here.
cs The camera state to update. See Structure CameraState.
Note:
The view vector and 'up' vector for the camera are stored with the matrix transform for the node. Cameras can be multiple-instanced so it must work this way. To get at this matrix use the following method from Class INode:
    virtual Matrix3 GetObjTMAfterWSM(TimeValue time, Interval* valid=NULL)=0;
The scaling of this matrix may be removed by normalizing each of the rows.
Returns:
REF_SUCCEED if the camera state was updated successfully; otherwise REF_FAIL.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetOrtho ( BOOL  b ) [pure virtual]

Sets whether the camera is on ortho mode or not.

Parameters:
b Pass TRUE for ortho and FALSE for not ortho.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual BOOL IsOrtho ( ) [pure virtual]

Returns TRUE if the camera is in ortho mode and FALSE if it is not.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetFOV ( TimeValue  t,
float  f 
) [pure virtual]

Sets the field-of-view of the camera at the specified time.

Parameters:
t The time at which to set the field-of-view.
f The value to set in radians.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual float GetFOV ( TimeValue  t,
Interval valid = Interval(0, 0) 
) [pure virtual]

Returns the field-of-view setting of the camera at the specified time and adjusts the validity interval of the camera at this time to reflect the field-of-view parameter.

Parameters:
t The time to retrieve the field-of-view setting.
valid The validity interval to set.
Returns:
The field-of-view of the camera in radians.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetTDist ( TimeValue  t,
float  f 
) [pure virtual]

Sets the target distance setting (for free cameras) at the specified time.

Parameters:
t The time at which to set the target distance.
f The value to set.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual float GetTDist ( TimeValue  t,
Interval valid = Interval(0, 0) 
) [pure virtual]

Returns the target distance setting of the camera at the specified time and adjusts the validity interval of the camera to reflect the target distance parameter.

Parameters:
t The time to retrieve the target distance setting.
valid This validity interval is intersected with the validity interval of the target distance parameter.
Returns:
The target distance of the camera.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual int GetManualClip ( ) [pure virtual]

Returns the manual clip flag.

This indicates the camera will perform clipping at its hither and yon distances.

Returns:
Nonzero if manual clipping is enabled; otherwise 0.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetManualClip ( int  onOff ) [pure virtual]

Sets the manual clip flag.

This indicates the camera will perform clipping at its hither and yon distances.

Parameters:
onOff The state of the manual clipping flag to set. Nonzero indicates clipping will be performed.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual float GetClipDist ( TimeValue  t,
int  which,
Interval valid = Interval(0, 0) 
) [pure virtual]

Retrieves the clipping distance of the specified plane at the specified time and modifies the validity interval to reflect the setting of the clipping distance parameter.

Parameters:
t The time to retrieve the clipping distance.
which Indicates which distance to return. One of the values in Clipping Distances
valid The validity interval that this method will update to reflect the clipping distance interval.
Returns:
The clipping distance.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetClipDist ( TimeValue  t,
int  which,
float  val 
) [pure virtual]

Sets the clipping distance of the specified plane at the specified time.

Parameters:
t The time to set the clipping distance.
which Indicates which distance to set. One of the values in Clipping Distances
val The distance to set.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetEnvRange ( TimeValue  time,
int  which,
float  f 
) [pure virtual]

Sets the environment range distance at the specified time.

Parameters:
time The time to set the environment range.
which Indicates which distance to set. One of the values in Environment Range Distances
f The distance to set.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual float GetEnvRange ( TimeValue  t,
int  which,
Interval valid = Interval(0, 0) 
) [pure virtual]

Retrieves the environment range distance at the specified time and intersects the specified validity interval with the interval of the environment range parameter.

Parameters:
t The time to retrieve the environment range.
which Indicate which distance to set. One of the values in Environment Range Distances
valid The validity interval that this method will update to reflect the environment range setting.
Returns:
The environment range distance at the specified time.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void SetEnvDisplay ( BOOL  b,
int  notify = TRUE 
) [pure virtual]

Sets the environment range display flag.

This indicates if the camera will display its range settings.

Parameters:
b The flag state to set.
notify If notify is TRUE, dependents of this message are sent the REFMSG_CHANGE message using NotifyDependents(FOREVER, PART_OBJ, REFMSG_CHANGE); Otherwise no notification is sent.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual BOOL GetEnvDisplay ( void  ) [pure virtual]

Retrieves the environment range display setting.

Returns:
TRUE if ranges are displayed; otherwise FALSE.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void RenderApertureChanged ( TimeValue  t ) [pure virtual]

This method is called on all cameras when the render aperture width has changed.

Parameters:
t The time of the change.

Implemented in MSPluginCamera, and MSCameraXtnd.

virtual void UpdateTargDistance ( TimeValue  t,
INode inode 
) [inline, virtual]

This method is called on all target cameras when the target distance has changed.

For instance, a distance shown in the user interface may be updated in this method.

Parameters:
t The time of the change.
inode The camera node.

Reimplemented in MSPluginCamera, and MSCameraXtnd.

{ }
virtual void SetMultiPassEffectEnabled ( TimeValue  t,
BOOL  enabled 
) [inline, virtual]

Enables or disables the multi-pass effect.

Parameters:
t The time at which to enable the effect.
enabled TRUE for enabled; FALSE for disabled.

Reimplemented in MSCameraXtnd.

{ }
virtual BOOL GetMultiPassEffectEnabled ( TimeValue  t,
Interval valid 
) [inline, virtual]

Returns the enabled or disabled state of the multi-pass effect setting for the camera.

Parameters:
t The time at which to get the setting.
valid The validity interfal for the setting.
Returns:
TRUE for enabled; FALSE for disabled.

Reimplemented in MSCameraXtnd.

{ return FALSE; }
virtual void SetMPEffect_REffectPerPass ( BOOL  enabled ) [inline, virtual]
virtual BOOL GetMPEffect_REffectPerPass ( ) [inline, virtual]

Reimplemented in MSCameraXtnd.

{ return FALSE; }
virtual void SetIMultiPassCameraEffect ( IMultiPassCameraEffect pIMultiPassCameraEffect ) [inline, virtual]

The IMultiPassCameraEffect should be checked to see if compatible with the camera before being assigned.

Parameters:
pIMultiPassCameraEffect The IMultiPassCameraEffect to assign.

Reimplemented in MSCameraXtnd.

{ }
virtual IMultiPassCameraEffect* GetIMultiPassCameraEffect ( ) [inline, virtual]

Returns a pointer to the current multi-pass camera effect.

See Class IMultiPassCameraEffect.

Reimplemented in MSCameraXtnd.

{ return NULL; }

CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject
CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject CameraObject