21 requires std::is_floating_point_v<T>
35 !std::isfinite(
y) || !std::isfinite(
width) ||
81 UncheckedTag) noexcept :
86 MinimumDepth_(minimumDepth),
87 MaximumDepth_(maximumDepth)
102 template <
typename T>
112 if (
clip.W() ==
T(0) || !std::isfinite(
clip.W()))
118 return std::isfinite(
result.X()) && std::isfinite(
result.Y()) &&
120 ? std::optional<Point3<T>>(
result)
124 template <
typename T>
133 if (
world.W() ==
T(0) || !std::isfinite(
world.W()))
139 return std::isfinite(
result.X()) && std::isfinite(
result.Y()) &&
141 ? std::optional<Point3<T>>(
result)
145 template <
typename T>
156 template <
typename T>
171 ?
T(0.5) -
ndc->Y() *
T(0.5)
172 :
ndc->Y() *
T(0.5) +
T(0.5);
175 :
ndc->Z() *
T(0.5) +
T(0.5);
183 template <
typename T>
184 [[nodiscard]]
inline std::optional<Point3<T>>
209 template <
typename T>
244 template <
typename T>
static std::optional< Direction3 > TryFrom(const Vec3< T > &value) noexcept
static std::optional< Ray3 > TryFromOriginDirection(const Point3< T > &origin, const Direction3< T > &direction) noexcept
T MaximumDepth() const noexcept
T Height() const noexcept
static std::optional< Viewport > TryFrom(T x, T y, T width, T height, T minimumDepth=T(0), T maximumDepth=T(1)) noexcept
T MinimumDepth() const noexcept
std::optional< Ray3< T > > TryMakeViewportRay(const Mat4< T > &clipToWorld, const Vec2< T > &viewportPosition, const Viewport< T > &viewport, ClipDepth clipDepth, DepthDirection depthDirection, ViewportYAxis yAxis=ViewportYAxis::Down) noexcept
std::optional< Point3< T > > TryUnprojectFromViewportWithInverse(const Mat4< T > &clipToWorld, const Point3< T > &viewportPoint, const Viewport< T > &viewport, ClipDepth clipDepth, ViewportYAxis yAxis=ViewportYAxis::Down) noexcept
std::optional< Point3< T > > TryProjectPoint(const Mat4< T > &worldToClip, const Point3< T > &worldPoint) noexcept
std::optional< Point3< T > > TryUnprojectPoint(const Mat4< T > &worldToClip, const Point3< T > &normalizedDevicePoint) noexcept
std::optional< Ray3< T > > TryMakePerspectiveViewportRay(const Mat4< T > &clipToWorld, const Point3< T > &cameraOrigin, const Vec2< T > &viewportPosition, const Viewport< T > &viewport, ClipDepth clipDepth, DepthDirection depthDirection, ViewportYAxis yAxis=ViewportYAxis::Down) noexcept
std::optional< Point3< T > > TryUnprojectPointWithInverse(const Mat4< T > &clipToWorld, const Point3< T > &normalizedDevicePoint) noexcept
std::optional< Point3< T > > TryProjectToViewport(const Mat4< T > &worldToClip, const Point3< T > &worldPoint, const Viewport< T > &viewport, ClipDepth clipDepth, ViewportYAxis yAxis=ViewportYAxis::Down) noexcept