ai_cameras.h
1 /*
2  * Arnold API header file
3  * Copyright (c) 1998-2009 Marcos Fajardo, (c) 2009-2013 Solid Angle SL
4  */
5 
11 #pragma once
12 #include "ai_nodes.h"
13 #include "ai_vector.h"
14 
20 typedef struct AtCameraInput {
21  float sx, sy;
22  float dsx, dsy;
23  float lensx, lensy;
24  float relative_time;
26 
35 typedef struct AtCameraOutput {
38  AtVector dOdx, dOdy;
39  AtVector dDdx, dDdy;
40  float weight;
42 
44 typedef struct AtCameraNodeMethods {
45  void (*CreateRay)(const AtNode*, const AtCameraInput*, AtCameraOutput*, int tid);
47 
49 #define AI_CAMERA_NODE_EXPORT_METHODS(tag) \
50 AI_INSTANCE_COMMON_METHODS \
51 camera_create_ray; \
52 static AtCameraNodeMethods ai_cam_mtds = { \
53  CameraCreateRay \
54 }; \
55 static AtNodeMethods ai_node_mtds = { \
56  &ai_common_mtds, \
57  &ai_cam_mtds \
58 }; \
59 AtNodeMethods* tag = &ai_node_mtds;
60 
65 AI_API void AiCameraInitialize(AtNode* node, void* data);
66 AI_API void AiCameraUpdate(AtNode* node, bool plane_distance);
67 AI_API void AiCameraDestroy(AtNode* node);
68 AI_API void* AiCameraGetLocalData(const AtNode* node);
69 /*\}*/
70 
77 #define camera_create_ray \
78 static void CameraCreateRay(const AtNode* node, const AtCameraInput* input, AtCameraOutput* output, int tid)
79 
80 /* \}*/
81 
82 /*\}*/

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com