Public Member Functions

MSCameraXtnd Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSCameraXtnd:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSCameraXtnd (MSPluginClass *pc, BOOL loading)
  ~MSCameraXtnd ()
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
int  Display (TimeValue t, INode *inode, ViewExp *vpt, int flags)
  This is called by the system to have the item display itself (perform a quick render in viewport, using the current TM).
void  GetWorldBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &abox)
  This method returns the world space bounding box for Objects (see below for the Sub-object gizmo or Modifiers gizmo version).
void  GetLocalBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &abox)
  This is the object space bounding box, the box in the object's local coordinates.
void  GetDeformBBox (TimeValue t, Box3 &abox, Matrix3 *tm, BOOL useSel)
  This method computes the bounding box in the objects local coordinates or the optional space defined by tm.
int  HitTest (TimeValue t, INode *inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt)
  This method is called to determine if the specified screen point intersects the item.
void  Snap (TimeValue t, INode *inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt)
  Checks the point passed for a snap and updates the SnapInfo structure.
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.
void  SetMultiPassEffectEnabled (TimeValue t, BOOL enabled)
  Enables or disables the multi-pass effect.
BOOL  GetMultiPassEffectEnabled (TimeValue t, Interval &valid)
  Returns the enabled or disabled state of the multi-pass effect setting for the camera.
void  SetMPEffect_REffectPerPass (BOOL enabled)
BOOL  GetMPEffect_REffectPerPass ()
void  SetIMultiPassCameraEffect (IMultiPassCameraEffect *pIMultiPassCameraEffect)
  The IMultiPassCameraEffect should be checked to see if compatible with the camera before being assigned.
IMultiPassCameraEffect GetIMultiPassCameraEffect ()
  Returns a pointer to the current multi-pass camera effect.
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))

Constructor & Destructor Documentation

MSCameraXtnd ( MSPluginClass *  pc,
BOOL  loading 
)
~MSCameraXtnd ( ) [inline]

Member Function Documentation

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 MSPluginCamera.

int Display ( TimeValue  t,
INode inode,
ViewExp vpt,
int  flags 
) [virtual]

This is called by the system to have the item display itself (perform a quick render in viewport, using the current TM).

Note: For this method to be called the object's validity interval must be invalid at the specified time t. If the interval is valid, the system may not call this method since it thinks the display is already valid.

Parameters:
t The time to display the object.
inode The node to display.
vpt An interface pointer that may be used to call methods associated with the viewports.
flags See Display Flags.
Returns:
The return value is not currently used.

Reimplemented from MSObjectXtnd< GenCamera, MSPluginCamera >.

void GetWorldBoundBox ( TimeValue  t,
INode inode,
ViewExp vp,
Box3 box 
) [virtual]

This method returns the world space bounding box for Objects (see below for the Sub-object gizmo or Modifiers gizmo version).

The bounding box returned by this method does not need to be precise. It should however be calculated rapidly. The object can handle this by transforming the 8 points of its local bounding box into world space and take the minimums and maximums of the result. Although this isn't necessarily the tightest bounding box of the objects points in world space, it is close enough.

Parameters:
t The time to compute the bounding box.
inode The node to calculate the bounding box for.
vp An interface pointer that can be used to call methods associated with the viewports.
box Contains the returned bounding box.

Reimplemented from MSObjectXtnd< GenCamera, MSPluginCamera >.

void GetLocalBoundBox ( TimeValue  t,
INode inode,
ViewExp vp,
Box3 box 
) [virtual]

This is the object space bounding box, the box in the object's local coordinates.

The system expects that requesting the object space bounding box will be fast.

Parameters:
t The time to retrieve the bounding box.
inode The node to calculate the bounding box for.
vp An interface pointer that may be used to call methods associated with the viewports.
box Contains the returned bounding box.

Reimplemented from MSObjectXtnd< GenCamera, MSPluginCamera >.

void GetDeformBBox ( TimeValue  t,
Box3 box,
Matrix3 tm,
BOOL  useSel 
) [virtual]

This method computes the bounding box in the objects local coordinates or the optional space defined by tm.

Note: If you are looking for a precise bounding box, use this method and pass in the node's object TM (INode::GetObjectTM()) as the matrix.

Parameters:
t The time to compute the box.
box A reference to a box the result is stored in.
tm This is an alternate coordinate system used to compute the box. If the tm is not NULL this matrix should be used in the computation of the result.
useSel If TRUE, the bounding box of selected sub-elements should be computed; otherwise the entire object should be used.

Reimplemented from MSObjectXtnd< GenCamera, MSPluginCamera >.

int HitTest ( TimeValue  t,
INode inode,
int  type,
int  crossing,
int  flags,
IPoint2 p,
ViewExp vpt 
) [virtual]

This method is called to determine if the specified screen point intersects the item.

The method returns nonzero if the item was hit; otherwise 0.

Parameters:
t The time to perform the hit test.
inode A pointer to the node to test.
type The type of hit testing to perform. See Scene and Node Hit Test Types. for details.
crossing The state of the crossing setting. If TRUE crossing selection is on.
flags The hit test flags. See Scene and Node Hit Testing Flags for details.
p The screen point to test.
vpt An interface pointer that may be used to call methods associated with the viewports.
Returns:
Nonzero if the item was hit; otherwise 0.

Reimplemented from MSObjectXtnd< GenCamera, MSPluginCamera >.

void Snap ( TimeValue  t,
INode inode,
SnapInfo snap,
IPoint2 p,
ViewExp vpt 
) [virtual]

Checks the point passed for a snap and updates the SnapInfo structure.

Note:
Developers wanting to find snap points on an Editable Mesh object should see the method XmeshSnap::Snap() in /MAXSDK/SAMPLES/SNAPS/XMESH/XMESH.CPP.
Parameters:
t The time to check.
inode The node to check.
snap The snap info structure to update.
p The screen point to check.
vpt An interface pointer that may be used to call methods associated with the viewports.

Reimplemented from MSObjectXtnd< GenCamera, MSPluginCamera >.

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

Reimplemented from MSPluginCamera.

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.

Reimplemented from MSPluginCamera.

{ delegate->SetOrtho(b); }
BOOL IsOrtho ( ) [inline, virtual]

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

Reimplemented from MSPluginCamera.

{ return delegate->IsOrtho(); }
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.

Reimplemented from MSPluginCamera.

{ delegate->SetFOV(time, f); } 
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.

Reimplemented from MSPluginCamera.

{ return delegate->GetFOV(t, valid); }
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.

Reimplemented from MSPluginCamera.

{ delegate->SetTDist(time, f); } 
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.

Reimplemented from MSPluginCamera.

{ return delegate->GetTDist(t, valid); }
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.

Reimplemented from MSPluginCamera.

{ return delegate->GetManualClip(); }
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.

Reimplemented from MSPluginCamera.

{ delegate->SetManualClip(onOff); }
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.

Reimplemented from MSPluginCamera.

{ return delegate->GetClipDist(t, which, valid); }
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.

Reimplemented from MSPluginCamera.

{ delegate->SetClipDist(t, which, val); }
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.

Reimplemented from MSPluginCamera.

{ delegate->SetEnvRange(time, which, f); } 
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.

Reimplemented from MSPluginCamera.

{ return delegate->GetEnvRange(t, which, valid); }
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.

Reimplemented from MSPluginCamera.

{ delegate->SetEnvDisplay(b, notify); }
BOOL GetEnvDisplay ( void  ) [inline, virtual]

Retrieves the environment range display setting.

Returns:
TRUE if ranges are displayed; otherwise FALSE.

Reimplemented from MSPluginCamera.

{ return delegate->GetEnvDisplay(); }
void RenderApertureChanged ( TimeValue  t ) [virtual]

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

Parameters:
t The time of the change.

Reimplemented from MSPluginCamera.

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 MSPluginCamera.

{ delegate->UpdateTargDistance(t, inode); }
int UsesWireColor ( ) [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 MSPluginCamera.

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

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

{ return delegate->GetMultiPassEffectEnabled(t, valid); }
void SetMPEffect_REffectPerPass ( BOOL  enabled ) [inline, virtual]
BOOL GetMPEffect_REffectPerPass ( ) [inline, 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 from CameraObject.

{ delegate->SetIMultiPassCameraEffect(pIMultiPassCameraEffect); }
IMultiPassCameraEffect* GetIMultiPassCameraEffect ( ) [inline, virtual]

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

See Class IMultiPassCameraEffect.

Reimplemented from CameraObject.

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.

Reimplemented from MSPluginCamera.

{ return delegate->NewCamera(type); }
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.

Reimplemented from MSPluginCamera.

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

Reimplemented from MSPluginCamera.

{ return delegate->GetConeState(); }
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.

Reimplemented from MSPluginCamera.

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

Reimplemented from MSPluginCamera.

{ return delegate->GetHorzLineState(); }
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.

Reimplemented from MSPluginCamera.

{ delegate->Enable(enab); }
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.

Reimplemented from MSPluginCamera.

{ return delegate->SetFOVControl(c); }
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

Reimplemented from MSPluginCamera.

{ delegate->SetFOVType(ft); }
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

Reimplemented from MSPluginCamera.

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

Reimplemented from MSPluginCamera.

{ return delegate->GetFOVControl(); }
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)

Reimplemented from MSPluginCamera.

{ return delegate->Type(); }
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)

Reimplemented from MSPluginCamera.

{ delegate->SetType(tp); }
void SetDOFEnable ( TimeValue  t,
BOOL  onOff 
) [inline, virtual]

Reimplemented from MSPluginCamera.

{ delegate->SetDOFEnable(t, onOff); }
BOOL GetDOFEnable ( TimeValue  t,
Interval valid = Interval(0,0) 
) [inline, virtual]

Reimplemented from MSPluginCamera.

{ return delegate->GetDOFEnable(t, valid); }
void SetDOFFStop ( TimeValue  t,
float  fs 
) [inline, virtual]
float GetDOFFStop ( TimeValue  t,
Interval valid = Interval(0,0) 
) [inline, virtual]

Reimplemented from MSPluginCamera.

{ return delegate->GetDOFFStop(t, valid); }

MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd
MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd MSCameraXtnd