21 name =
"unknonw repere";
69 GtoL[0][3] = -
U.x *
O.x -
U.y *
O.y -
U.z *
O.z;
73 GtoL[1][3] = -
V.x *
O.x -
V.y *
O.y -
V.z *
O.z;
77 GtoL[2][3] = -
W.x *
O.x -
W.y *
O.y -
W.z *
O.z;
87 result.x = local.x *
LtoG[0][0] + local.y *
LtoG[0][1] + local.z *
LtoG[0][2];
88 result.y = local.x *
LtoG[1][0] + local.y *
LtoG[1][1] + local.z *
LtoG[1][2];
89 result.z = local.x *
LtoG[2][0] + local.y *
LtoG[2][1] + local.z *
LtoG[2][2];
97 result.x = global.x *
GtoL[0][0] + global.y *
GtoL[0][1] + global.z *
GtoL[0][2];
98 result.y = global.x *
GtoL[1][0] + global.y *
GtoL[1][1] + global.z *
GtoL[1][2];
99 result.z = global.x *
GtoL[2][0] + global.y *
GtoL[2][1] + global.z *
GtoL[2][2];
106 vec4 local4 = vec4(local);
109 result4.x = local4.x *
LtoG[0][0] + local4.y *
LtoG[0][1] + local4.z *
LtoG[0][2] + local4.w *
LtoG[0][3];
110 result4.y = local4.x *
LtoG[1][0] + local4.y *
LtoG[1][1] + local4.z *
LtoG[1][2] + local4.w *
LtoG[1][3];
111 result4.z = local4.x *
LtoG[2][0] + local4.y *
LtoG[2][1] + local4.z *
LtoG[2][2] + local4.w *
LtoG[2][3];
112 result4.w = local4.x *
LtoG[3][0] + local4.y *
LtoG[3][1] + local4.z *
LtoG[3][2] + local4.w *
LtoG[3][3];
114 vec3 result =
vec3(result4.x / result4.w, result4.y / result4.w, result4.z / result4.w);
121 vec4 global4 = vec4(global);
125 global4.x *
GtoL[0][0] + global4.y *
GtoL[0][1] + global4.z *
GtoL[0][2] + global4.w *
GtoL[0][3];
127 global4.x *
GtoL[1][0] + global4.y *
GtoL[1][1] + global4.z *
GtoL[1][2] + global4.w *
GtoL[1][3];
129 global4.x *
GtoL[2][0] + global4.y *
GtoL[2][1] + global4.z *
GtoL[2][2] + global4.w *
GtoL[2][3];
131 global4.x *
GtoL[3][0] + global4.y *
GtoL[3][1] + global4.z *
GtoL[3][2] + global4.w *
GtoL[3][3];
133 vec3 result =
vec3(result4.x / result4.w, result4.y / result4.w, result4.z / result4.w);
Base class of Event, Material, PostFilter, Ray, Repere, Scene, Shape, Simulation, Source.
std::string name
Each instantiated object may be named.
vec3 U
Coordinates of local axis U in global frame.
decimal LtoG[4][4]
Local to global frame matrix.
vec3 vectorFromGlobalToLocal(const vec3 &global)
Get local coordinates of vector expressed in global coordinates.
vec3 positionFromLocalToGlobal(const vec3 &local)
Get global coordinates of a point expressed in local coordinates.
vec3 V
Coordinates of local axis V in global frame.
void updateMatrices()
Update the global and local frame matrices.
vec3 W
Coordinates of local axis W in global frame.
decimal GtoL[4][4]
Global to local frame matrix.
vec3 vectorFromLocalToGlobal(const vec3 &local)
Get global coordinates of vector expressed in local coordinates.
vec3 positionFromGlobalToLocal(const vec3 &global)
Get local coordinates of a point expressed in global coordinates.
vec3 O
Origin of the local frame in the global frame.
base_vec3< decimal > vec3