tinypbrt 1.1.1
pbrt-v4 scene file parser for C11 with a header-only C++20 wrapper
Loading...
Searching...
No Matches
coord.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef _TINYPBRT_COORD_HPP_
3#define _TINYPBRT_COORD_HPP_
4
6
8
9#include <string_view>
10
11namespace tpbrt {
31
38 [[nodiscard]] constexpr std::string_view to_string(const coord_system_type type) noexcept {
39 using enum coord_system_type;
40 switch (type) {
41 case CAMERA_WORLD: return "cameraworld";
42 case CAMERA: return "camera";
43 case WORLD: return "world";
44 case MAX_NUM: return "maxnum";
45 default: return "UNKNOWN";
46 }
47 }
48} // namespace tpbrt
49#endif // _TINYPBRT_COORD_HPP_
constexpr std::string_view to_string(const accelerator_type type) noexcept
Converts accelerator_type enum value to string.
Definition accelerator.hpp:39
@ MAX_NUM
Count of available accelerator types.
tpbrt_uchar_t uchar_t
Unsigned char type.
Definition fwd.hpp:34
coord_system_type
Coordinate System type.
Definition coord.hpp:21
@ WORLD
Uses world space (accuracy may suffer due to floating-point precision).
@ CAMERA_WORLD
Translates the scene so that the camera is at the origin.
@ CAMERA
Uses camera space (performance may suffer due to the scene being rotated).
@ TPBRT_COORD_SYSTEM_TYPE_MAX_NUM
Count of available coordinate system types.
Definition coord.h:28
@ TPBRT_COORD_SYSTEM_TYPE_WORLD
Uses world space (accuracy may suffer due to floating-point precision).
Definition coord.h:26
@ TPBRT_COORD_SYSTEM_TYPE_CAMERA
Uses camera space (performance may suffer due to the scene being rotated).
Definition coord.h:24
@ TPBRT_COORD_SYSTEM_TYPE_CAMERA_WORLD
Translates the scene so that the camera is at the origin.
Definition coord.h:22
Definition accelerator.hpp:14