Inheritance diagram for I3DShCamera:

Public Member Functions | |
| virtual MCCOMErr MCCOMAPI | GetGlobalToCameraTransform (TTransform3D *transform) const =0 |
| virtual MCCOMErr MCCOMAPI | Preset (uint32 preset, const TVector3 &aimedPoint, real distance)=0 |
| virtual boolean MCCOMAPI | IsProjectionAffine (void) const =0 |
| virtual boolean MCCOMAPI | PreProject3DTo2D (const TVector3 &cameraPosition, TVector4 &projectedPosition) const =0 |
| virtual boolean MCCOMAPI | Project3DTo2D (const TVector3 *position, TVector2 *resultScreenPosition, real *resultDistanceToScreen) const =0 |
| virtual boolean MCCOMAPI | CreateRay (const TVector2 *screenPosition, TVector3 *resultOrigin, TVector3 *resultDirection) const =0 |
| virtual boolean MCCOMAPI | CreateRay (const TVector2 &screenPosition, const TVector2 &screenDerivate, Ray3D &ray) const =0 |
| virtual I3DExCamera *MCCOMAPI | GetValidExCameraNoAddRef ()=0 |
| virtual MCCOMErr MCCOMAPI | GetRenderUVBox (TBBox2D *uvBox, uint32 width, uint32 height, real pixelAspectRatio) const =0 |
| virtual MCCOMErr MCCOMAPI | SetCameraComponent (int32 kindID)=0 |
| virtual MCCOMErr MCCOMAPI | SetCameraComponent (IShComponent *cameraComponent, ECloneMode cloneMode)=0 |
| virtual MCCOMErr MCCOMAPI | GetCameraComponent (IShComponent **cameraComponent)=0 |
| virtual void MCCOMAPI | GetStandardCameraInfo (TStandardCameraInfo &cameraInfo) const =0 |
| virtual void MCCOMAPI | SetCanonicalCameraType (ECanonicalCameraType canonicalCameraType)=0 |
| virtual ECanonicalCameraType MCCOMAPI | GetCanonicalCameraType ()=0 |
| virtual void MCCOMAPI | SetProductionOffset (const TVector2 &inOffset)=0 |
| virtual TVector2 MCCOMAPI | GetProductionOffset () const =0 |
| virtual void MCCOMAPI | SetProductionZoom (real zoom)=0 |
| virtual real MCCOMAPI | GetProductionZoom () const =0 |
| virtual I3DShTreeElement *MCCOMAPI | GetTreeElement ()=0 |
| virtual void MCCOMAPI | SetRenderingUVBox (const TBBox2D &inUVBox)=0 |
The structure of a camera is a little bit more complex that the typical component. It is similar to the structure of Lights and Primitives.
There are 2 COM objects to consider:
For advanced users: You should note that there are actually 3 C++ object (The camera instance, the camera component and the external camera). However the camera component and the external camera are aggregated by COM which means that you can be considered as one single COM object).
To get a pointer to a I3DShCamera from a I3DExCamera, you can use the following code:
TMCCountedPtr<I3DShTreeElementMember> cameraComponent; exCamera->QueryInterface(IID_I3DShTreeElementMember,(void**)&cameraComponent); ThrowIfNil(cameraComponent); TMCCountedPtr<I3DShTreeElement> cameraTree; cameraComponent->GetTreeElement(&cameraTree); ThrowIfNil(cameraTree); TMCCountedPtr<I3DShCamera> shCamera; cameraTree->QueryInterface(IID_I3DShCamera.(void**)&shCamera);
To access I3DExCamera from I3DShCamera, you can use the following code:
TMCCountedPtr<IShComponent> cameraComponent; shCamera->GetCameraComponent(&cameraComponent); ThrowIfNil(cameraComponent); TMCCountedPtr<I3DExCamera> exCamera; cameraComponent->QueryInterface(IID_I3DExCamera,(void**)&exCamera);
This code might seem a bit complicated at first but it is actually simple. You have two COM objects that point on each other. I3DShCamera::GetCameraComponent() and I3DShTreeElementMember::GetTreeElement() allow you to get a pointer from one object to the other. The rest is only calling QueryInterface to get the right interface on each object.
Whenever it is possible you should use the Shell interface (I3DShCamera) to access the camera because the Shell will make sure that the parameter map of the external component is valid. This is especially important if the component is animated. For more information on components see the Overview of the SDK.
|
||||||||||||||||
|
Generates a ray through a given screen location with a given thickness (screenDerivate).
|
|
||||||||||||||||
|
Generates a ray through a given screen location. Note that in this case the ray has no width. To get a ray with a width you should use the next call.
|
|
|
Returns a pointer to the camera component.
|
|
|
Returns the type of camera (see I3DEditorHostPart for more info on canonical cameras). |
|
|
Returns the transform from Global coordinates to Camera Coordinates.
|
|
|
Returns the product offset. |
|
|
Returns the size (zoom) of the production frame. |
|
||||||||||||||||||||
|
Returns the production frame in screen coordinates.
|
|
|
Returns the standard camera info used in the interactive renderers (in the 3D View). For perfomance reasons the interactive renderers use this function to get an approximation of the camera that is used to perform the rendering.
|
|
|
Returns the I3DShTreeElement interface. This call is faster than calling QueryInterface. |
|
|
Returns a valid external camera for the current time (to by pass the app for speed) You should use this call with extreme caution: It assumes nothing will be changed in the scene while you use the external interface. In particular, if the time is changed you should call this function to get a new pointer. |
|
|
Returns true if the projection is affine (if w component from projection is always 1.0) |
|
||||||||||||
|
|
|
||||||||||||||||
|
Sends the camera to a reference position.
|
|
||||||||||||||||
|
Projects a point in camera coordinates on the screen.
|
|
||||||||||||
|
Sets the camera component.
|
|
|
Sets the kind of this camera.
|
|
|
Sets the type of camera when it is a canonical camera (see I3DEditorHostPart).
|
|
|
Sets the offset of the production frame.
|
|
|
Sets the size of the production frame.
|
|
|
Notifies the external camera of the screen coordinates bounding box that is going to be used during the rendering. The Camera should store that information and use it if needed in CreateRay/PreProject3DTo2D/Project3DTo2D So far only the spherical camera needs this
|
1.3.9.1