Class frame_t

Class Documentation

class frame_t

Public Functions

inline pqvec2_t to_local(const pqvec2_t &v) const noexcept
inline pqvec3_t to_local(const pqvec3_t &v) const noexcept
inline pqvec3_t to_world(const pqvec2_t &v) const noexcept
inline pqvec3_t to_world(const pqvec3_t &v) const noexcept
inline vec2_t to_local(const vec2_t &v) const noexcept
inline vec3_t to_local(const vec3_t &v) const noexcept
inline auto to_world(const vec2_t &v) const noexcept
inline auto to_world(const vec3_t &v) const noexcept
inline dir3_t to_local(const dir3_t &v) const noexcept
inline dir2_t to_local(const dir2_t &v) const noexcept
inline dir3_t to_world(const dir3_t &v) const noexcept
inline dir3_t to_world(const dir2_t &v) const noexcept
inline f_t handness() const noexcept

Tests the handness of the frame. Returns +1 for RH systems and -1 for LH systems.

inline auto flip() const noexcept

Returns a flipped frame (flipped t,b,n)

inline auto operator-() const noexcept

Returns a flipped frame (flipped t,b,n)

inline auto flip_handness() const noexcept

Returns a frame with flipped handness (flipped bitangent)

template<std::size_t W>
inline auto to_local(const pqvec3_w_t<W> &v) const noexcept

Vectorized 8x transform to local space. Input in metres.

template<std::size_t W>
inline auto to_local(const vec3_w_t<W> &v) const noexcept

Vectorized 8x transform to local space. Dimensionless input.

Public Members

dir3_t t
dir3_t b
dir3_t n

Public Static Functions

static inline frame_t canonical() noexcept

Returns the canonical frame: normal direction aligns with z axis, and tangent and bitangent with x and y axes, respectively.

static inline frame_t build_shading_frame(const dir3_t &n, const pqvec3_t &dpdu) noexcept

Builds a frame with normal n and its tangent direction aligning as closely as possible with dpdu.

static inline frame_t build_orthogonal_frame(const dir3_t &n) noexcept

Builds an arbitrary frame with normal n.

Friends

inline friend auto operator*(const mat3_t &R, const frame_t &f) noexcept

Transforms the frame via R. R is assumed to be an orthogonal matrix.