Data Structures | Macros
Camera Nodes

Camera initialization and update, and custom camera node implementation. More...

Data Structures

struct  AtCameraInput
 Camera ray creation inputs. More...
 
struct  AtCameraOutput
 Camera ray creation outputs. More...
 
struct  AtCameraNodeMethods
 Camera node methods structure. More...
 

Macros

#define AI_CAMERA_NODE_EXPORT_METHODS(tag)
 Camera node methods exporter. More...
 

API Methods for Camera Writers

AI_API void AiCameraInitialize (AtNode *node)
 Initialize the camera's internal data. More...
 
AI_API void AiCameraUpdate (AtNode *node, bool plane_distance)
 Updates camera's internal data. More...
 

Node Method Declarations

#define camera_create_ray   static void CameraCreateRay(const AtNode* node, const AtCameraInput& input, AtCameraOutput& output, uint16_t tid)
 Camera's camera_create_ray method declaration. More...
 
#define camera_reverse_ray   static bool CameraReverseRay(const AtNode* node, const AtVector &Po, float relative_time, AtVector2 &Ps)
 Camera's camera_reverse_ray method declaration. More...
 

Detailed Description

Camera initialization and update, and custom camera node implementation.

Macro Definition Documentation

#define AI_CAMERA_NODE_EXPORT_METHODS (   tag)
Value:
static AtCameraNodeMethods ai_cam_mtds = { \
CameraCreateRay, \
CameraReverseRay \
}; \
static AtNodeMethods ai_node_mtds = { \
&ai_common_mtds, \
&ai_cam_mtds \
}; \
const AtNodeMethods* tag = &ai_node_mtds;
Node methods.
Definition: ai_node_entry.h:83
#define camera_reverse_ray
Camera's camera_reverse_ray method declaration.
Definition: ai_cameras.h:114
Camera node methods structure.
Definition: ai_cameras.h:50
#define camera_create_ray
Camera's camera_create_ray method declaration.
Definition: ai_cameras.h:96

Camera node methods exporter.

#define camera_create_ray   static void CameraCreateRay(const AtNode* node, const AtCameraInput& input, AtCameraOutput& output, uint16_t tid)

Camera's camera_create_ray method declaration.

This function is called for the camera to return a ray origin and direction given a point in 2d screen coordinates.

Parameters
nodepointer to the camera node itself
inputAtCameraInput data required to generate a new ray (screen position, derivatives, etc...)
[out]outputCamera ray origin, direction and weight. Derivatives are set to zero by default. Estimates will be computed if they are not set.
tidthread ID that will cast this ray
#define camera_reverse_ray   static bool CameraReverseRay(const AtNode* node, const AtVector &Po, float relative_time, AtVector2 &Ps)

Camera's camera_reverse_ray method declaration.

This function is the reverse of camera_create_ray: given a point in camera space 3d coordinates return the corresponding 2d screen coordinates.

Parameters
nodepointer to the camera node itself
PoPoint in camera space
relative_timeRelative time to compute the projection in
[out]PsOutput point in screen space
Returns
True if a screen space projection exists and False otherwise. Points that fall outside the frame should return True and compute the corresponding screen coordinates, only points with no projection at all should return False. False can also be returned if there's no implementation available.

Function Documentation

AI_API void AiCameraInitialize ( AtNode node)

Initialize the camera's internal data.

This must be called once and only once during node_initialize

Parameters
nodepointer to the camera node
AI_API void AiCameraUpdate ( AtNode node,
bool  plane_distance 
)

Updates camera's internal data.

This must be called during node_update

Parameters
nodepointer to the camera node
plane_distancewill the Z-depth and near/far clip be computed from the camera plane, or from the camera point?

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com