Public Member Functions | Static Public Member Functions

MSPluginCamera Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSPluginCamera:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSPluginCamera ()
  MSPluginCamera (MSPluginClass *pc, BOOL loading)
  ~MSPluginCamera ()
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
RefResult  EvalCameraState (TimeValue time, Interval &valid, CameraState *cs)
  This method is called to update the CameraState and validity interval at the specified time.
void  SetOrtho (BOOL b)
  Sets whether the camera is on ortho mode or not.
BOOL  IsOrtho ()
  Returns TRUE if the camera is in ortho mode and FALSE if it is not.
void  SetFOV (TimeValue time, float f)
  Sets the field-of-view of the camera at the specified time.
float  GetFOV (TimeValue t, Interval &valid=Interval(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.
void  SetTDist (TimeValue time, float f)
  Sets the target distance setting (for free cameras) at the specified time.
float  GetTDist (TimeValue t, Interval &valid=Interval(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.
int  GetManualClip ()
  Returns the manual clip flag.
void  SetManualClip (int onOff)
  Sets the manual clip flag.
float  GetClipDist (TimeValue t, int which, Interval &valid=Interval(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.
void  SetClipDist (TimeValue t, int which, float val)
  Sets the clipping distance of the specified plane at the specified time.
void  SetEnvRange (TimeValue time, int which, float f)
  Sets the environment range distance at the specified time.
float  GetEnvRange (TimeValue t, int which, Interval &valid=Interval(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.
void  SetEnvDisplay (BOOL b, int notify=TRUE)
  Sets the environment range display flag.
BOOL  GetEnvDisplay (void)
  Retrieves the environment range display setting.
void  RenderApertureChanged (TimeValue t)
  This method is called on all cameras when the render aperture width has changed.
void  UpdateTargDistance (TimeValue t, INode *inode)
  This method is called on all target cameras when the target distance has changed.
int  UsesWireColor ()
  This method determines if the object color is used for display.
GenCamera NewCamera (int type)
void  SetConeState (int s)
int  GetConeState ()
void  SetHorzLineState (int s)
int  GetHorzLineState ()
void  Enable (int enab)
BOOL  SetFOVControl (Control *c)
void  SetFOVType (int ft)
int  GetFOVType ()
Control GetFOVControl ()
int  Type ()
void  SetType (int tp)
void  SetDOFEnable (TimeValue t, BOOL onOff)
BOOL  GetDOFEnable (TimeValue t, Interval &valid=Interval(0, 0))
void  SetDOFFStop (TimeValue t, float fs)
float  GetDOFFStop (TimeValue t, Interval &valid=Interval(0, 0))

Static Public Member Functions

static RefTargetHandle  create (MSPluginClass *pc, BOOL loading)

Constructor & Destructor Documentation

MSPluginCamera ( ) [inline]
{ }
MSPluginCamera ( MSPluginClass *  pc,
BOOL  loading 
)
~MSPluginCamera ( ) [inline]

Member Function Documentation

static RefTargetHandle create ( MSPluginClass *  pc,
BOOL  loading 
) [static]
RefTargetHandle Clone ( RemapDir remap ) [virtual]

This method is used by 3ds Max to clone an object.

See also:
CloneRefHierarchy(), class RemapDir This method is called by 3ds Max to have the plugin clone itself. The plug-in's implementation of this method should copy both the data structure and all the data residing in the data structure of this reference target. The plugin should clone all its references as well. Also, the plug-in's implementation of this method must call BaseClone(). In order for classes derived from this class to clone cleanly, the Clone method should just create the new instance, and then call an implementation of BaseClone that clones the references and copies any other necessary data. For example:
            class MyDerivedPlugin
                : public MyBasePlugin
            {
                const int MY_REFERENCE = 1;

                ReferenceTarget* Clone(RemapDir& remap)
                {
                    ReferenceTarget* result = new MyDerivedPlugin();
                    BaseClone(this, result, remap);
                    return result;
                }

                void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap)
                {
                    if (!to || !from || from == to)
                        return;    
                    MyBasePlugin::BaseClone(from, to, remap);
                    to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE)));
                }
            };

This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations

Note:
See the remarks in method BaseClone() below.
Parameters:
remap - A RemapDir instance used for remapping references during a Clone.
Returns:
A pointer to the cloned item.

Reimplemented from ReferenceTarget.

Reimplemented in MSCameraXtnd.

RefResult EvalCameraState ( TimeValue  time,
Interval valid,
CameraState cs 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return REF_SUCCEED; }
void SetOrtho ( BOOL  b ) [inline, virtual]

Sets whether the camera is on ortho mode or not.

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

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ }
BOOL IsOrtho ( ) [inline, virtual]

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

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return FALSE; }
void SetFOV ( TimeValue  t,
float  f 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ } 
float GetFOV ( TimeValue  t,
Interval valid = Interval(0, 0) 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return 0.0f; }
void SetTDist ( TimeValue  t,
float  f 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ } 
float GetTDist ( TimeValue  t,
Interval valid = Interval(0, 0) 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return 0.0f; }
int GetManualClip ( ) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{return 0;}
void SetManualClip ( int  onOff ) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ }
float GetClipDist ( TimeValue  t,
int  which,
Interval valid = Interval(0, 0) 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return 0.0f; }
void SetClipDist ( TimeValue  t,
int  which,
float  val 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ }
void SetEnvRange ( TimeValue  time,
int  which,
float  f 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ } 
float GetEnvRange ( TimeValue  t,
int  which,
Interval valid = Interval(0, 0) 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return 0.0f; }
void SetEnvDisplay ( BOOL  b,
int  notify = TRUE 
) [inline, 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.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ }
BOOL GetEnvDisplay ( void  ) [inline, virtual]

Retrieves the environment range display setting.

Returns:
TRUE if ranges are displayed; otherwise FALSE.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ return FALSE; }
void RenderApertureChanged ( TimeValue  t ) [inline, virtual]

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

Parameters:
t The time of the change.

Implements CameraObject.

Reimplemented in MSCameraXtnd.

{ }
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 from CameraObject.

Reimplemented in MSCameraXtnd.

{ }
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 CameraObject.

Reimplemented in MSCameraXtnd.

{ return CameraObject::UsesWireColor(); }   // TRUE if the object color is used for display
GenCamera* NewCamera ( int  type ) [inline, virtual]
Remarks:
Creates a new generic camera object.
Parameters:
int type

Nonzero if the camera has a target; otherwise 0.
Returns:
A pointer to a new instance of the specified light type.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return NULL; }
void SetConeState ( int  s ) [inline, virtual]
Remarks:
Sets if the camera cone is displayed in the viewports.
Parameters:
int s

Nonzero to display the camera cone; otherwise 0.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ }
int GetConeState ( ) [inline, virtual]
Remarks:
Returns TRUE if the camera cone is displayed in the viewports; otherwise FALSE.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return 0; }
void SetHorzLineState ( int  s ) [inline, virtual]
Remarks:
Sets if the camera has a horizon line displayed.
Parameters:
int s

Nonzero to display the horizon line; otherwise 0.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ }
int GetHorzLineState ( ) [inline, virtual]
Remarks:
Returns TRUE if the camera has a horizon line displayed; otherwise FALSE.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return 0; }
void Enable ( int  enab ) [inline, virtual]
Remarks:
Enables or disables the camera. If enabled the camera may be displayed, hit tested, etc.
Parameters:
int enab

Nonzero to enable; zero to disable.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ }
BOOL SetFOVControl ( Control c ) [inline, virtual]
Remarks:
Sets the controller for the field-of-view parameter.
Parameters:
Control *c

Points to the controller to set.
Returns:
Returns TRUE if set; otherwise FALSE.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return FALSE; }
void SetFOVType ( int  ft ) [inline, virtual]
Remarks:
This method is available in release 3.0 and later only.

Sets the Field-Of-View type of the camera.
Parameters:
int ft

One of the following values:

FOV_W

Width-related FOV

FOV_H

Height-related FOV

FOV_D

Diagonal-related FOV

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ }
int GetFOVType ( ) [inline, virtual]
Remarks:
This method is available in release 3.0 and later only.

Returns the Field-Of-View type of the camera. One of the following values:

FOV_W

Width-related FOV

FOV_H

Height-related FOV

FOV_D

Diagonal-related FOV

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return 0; }
Control* GetFOVControl ( ) [inline, virtual]
Remarks:
Returns the controller for the field-of-view parameter.

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return NULL; }
int Type ( ) [inline, virtual]
Remarks:
This method is available in release 3.0 and later only.

Returns one of the following values to indicate the camera type:

FREE_CAMERA (No Target)

TARGETED_CAMERA (Target / Look At Controller)

PARALLEL_CAMERA (Orthographic Camera)

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ return 0; }
void SetType ( int  tp ) [inline, virtual]
Remarks:
This method is available in release 3.0 and later only.

Sets the type of camera.
Parameters:
int tp

One of the following types:

FREE_CAMERA (No Target)

TARGETED_CAMERA (Target / Look At Controller)

PARALLEL_CAMERA (Orthographic Camera)

Implements GenCamera.

Reimplemented in MSCameraXtnd.

{ }
void SetDOFEnable ( TimeValue  t,
BOOL  onOff 
) [inline, virtual]

Reimplemented from GenCamera.

Reimplemented in MSCameraXtnd.

{}
BOOL GetDOFEnable ( TimeValue  t,
Interval valid = Interval(0,0) 
) [inline, virtual]

Reimplemented from GenCamera.

Reimplemented in MSCameraXtnd.

{ return 0; }
void SetDOFFStop ( TimeValue  t,
float  fs 
) [inline, virtual]

Reimplemented from GenCamera.

Reimplemented in MSCameraXtnd.

{}
float GetDOFFStop ( TimeValue  t,
Interval valid = Interval(0,0) 
) [inline, virtual]

Reimplemented from GenCamera.

Reimplemented in MSCameraXtnd.

{ return 1.0f; }

MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera
MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera MSPluginCamera