10#include <Common/assertion.h>
11#include <Common/primitive_type.h>
35 std::optional<math::Vector3R> m_dir;
36 std::optional<math::Vector3R> m_upAxis;
39 static math::QuaternionD makeRotFromYawPitchRoll(real yawDegrees, real pitchDegrees, real rollDegrees);
44 ClassType clazz(
"oriented-raster");
45 clazz.docName(
"Oriented Raster Observer");
47 "Observers that work by projecting incoming energy in certain ways. "
48 "Projective observers face the -z axis (+y up) and reside on (0, 0, 0) by default.");
52 pos.description(
"Position of the observer.");
53 pos.defaultTo({0, 0, 0});
58 "Direction that this observer is looking at in yaw pitch form. "
59 "yaw: Rotation around +y axis in [-180, 180]; "
60 "pitch: Declination from the horizon in [-90, 90]; "
61 "row: Rotation around +z axis in [-180, 180].");
64 clazz.addField(yawPitchRollDegrees);
67 dir.
description(
"Direction vector that this observer is looking at. No need to be normalized.");
71 upAxis.
description(
"The direction vector that this observer consider as upward. No need to be normalized.");
72 clazz.addField(upAxis);
Definition CoreCookedUnit.h:19
Definition CoreCookingContext.h:15
Definition OrientedRasterObserver.h:19
math::TDecomposedTransform< float64 > makeObserverPose() const
Definition OrientedRasterObserver.cpp:12
math::QuaternionD makeRot() const
Definition OrientedRasterObserver.cpp:25
void cook(const CoreCookingContext &ctx, CoreCookedUnit &cooked) override=0
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< OrientedRasterObserver >)
Definition OrientedRasterObserver.h:42
math::Vector3D makeDir() const
Definition OrientedRasterObserver.cpp:43
math::Vector3D makePos() const
Definition OrientedRasterObserver.cpp:20
OrientedRasterObserver()=default
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
Definition TSdlVector3.h:19
Represents a quaternion.
Definition TQuaternion.h:17
Represents a 3-D vector.
Definition TVector3.h:17
The root for all renderer implementations.
Definition EEngineProject.h:6