frame
Local coordinate frame.
Fields and methods
Members of the struct frame. Most of what you do with a CGP type goes through the free functions listed below.
Fields
rotation_transform orientation | Rotation giving the axes of the frame, the columns of its matrix being ux, uy and uz. |
vec3 position | Position of the origin of the frame. |
Methods
frame() | Builds the world frame (identity orientation, origin at zero).4 overloads src |
frame(rotation_transform const& orientation, vec3 const& position) | Builds the frame of the given orientation and origin position (explicit). src |
frame(affine_rt const& transformation) | Builds the frame with the rotation and translation of a rigid transform (explicit). src |
frame(vec3 const& ux, vec3 const& uy, vec3 const& position = {0,0,0}) | Builds the frame whose first two axes are the unit orthogonal vectors ux and uy (asserted), the third one being their cross product, with an origin position defaulting to zero (explicit). src |
| Returns the first axis of the frame, i.e. the first column of the orientation matrix. src | |
| Returns the second axis of the frame, i.e. the second column of the orientation matrix. src | |
| Returns the third axis of the frame, i.e. the third column of the orientation matrix. src | |
| Returns the 4x4 matrix ((R, position), (0, 1)) mapping frame coordinates to world coordinates. src |
Functions taking a frame
Construct 1
Documented on another page
mesh_primitive_frameMesh of the frame f: three arrows of length scale along ux, uy and uz (red, green and blue by default) and a sphere at its origin, the arrow radius being frame_thickness*scale.onmesh
Transform 1
Functions returning a frame
Construct 1
frame camera_frame_look_at(vec3 const& eye, vec3 const& center, vec3 const& up)Camera frame placed at eye and looking toward center (local -z axis), with its y axis aligned as much as possible with up.
Operators
Show the 5 operators (+, -, *, ==, ...)
frame operator+(frame const& f, vec3 const& tr)Copy of the frame with its position translated by tr.
frame operator-(frame const& f, vec3 const& tr)Copy of the frame with its position translated by -tr.
Documented on another page
operator*Frame transformed by the rigid transform: orientation and position are rotated, then the position is translated.onaffine_rtoperator*Frame rotated around the origin: both its orientation and its position are rotated.onrotation_transformoperator+Copy of the frame with its position translated by tr.onvec3