1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! Defines the Camera data structure
use ;
use ;
/// Helper structure to describe a virtual camera.
///
/// Cameras have a representation in the node graph and can be animated.
/// An important aspect is that the camera itself is also part of the
/// scenegraph. This means, any values such as the look-at vector are not
/// *absolute*, they're _relative_ to the coordinate system defined
/// by the node which corresponds to the camera. This allows for camera
/// animations. For static cameras parameters like the 'look-at' or 'up' vectors
/// are usually specified directly in Camera, but beware, they could also
/// be encoded in the node transformation.
///
/// The following (pseudo)code sample shows how to do it:
/// ```pseudo
/// // Get the camera matrix for a camera at a specific time
/// // if the node hierarchy for the camera does not contain
/// // at least one animated node this is a static computation
/// get-camera-matrix (node sceneRoot, camera cam) : matrix
/// {
/// node cnd = find-node-for-camera(cam)
/// matrix cmt = identity()
///
/// // as usual - get the absolute camera transformation for this frame
/// for each node nd in hierarchy from sceneRoot to cnd
/// matrix cur
/// if (is-animated(nd))
/// cur = eval-animation(nd)
/// else cur = nd->mTransformation;
/// cmt = mult-matrices( cmt, cur )
/// end for
///
/// // now multiply with the camera's own local transform
/// cam = mult-matrices (cam, get-camera-matrix(cmt) )
/// }
/// ```
///
/// Note: some file formats (such as 3DS, ASE) export a "target point" -
/// the point the camera is looking at (it can even be animated). Assimp
/// writes the target point as a subnode of the camera's main node,
/// called `<camName>.Target`. However this is just additional information
/// then the transformation tracks of the camera main node make the
/// camera already look in the right direction.
// vim: et tw=78 sw=4: