Move Vectormath main
C++20 game and graphics mathematics
Loading...
Searching...
No Matches
Transforms.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <algorithm>
4#include <cassert>
5#include <span>
6
11
12namespace mv::math
13{
14 inline void TransformPoints(std::span<const PackedVec3f> input,
16 std::span<gpu::Float3Slot16> output) noexcept
17 {
18 assert(output.size() >= input.size());
19 for (std::size_t index = 0; index < input.size(); ++index)
20 {
21 gpu::Store(output[index],
23 }
24 }
25
29 {
30 assert(output.Size() >= input.Size());
31 for (std::size_t index = 0; index < input.Size(); ++index)
32 {
33 Store(output[index], TransformPoint(transform, Load(input[index])));
34 }
35 }
36} // namespace mv::math
void Store(Float3Slot16 &destination, Vec3f value) noexcept
Definition Vectors.hpp:27
void Store(PackedVec2f &destination, Vec2f value) noexcept
Definition Vectors.hpp:57
Vec2f Load(const PackedVec2f &value) noexcept
Definition Vectors.hpp:42
void TransformPoints(std::span< const PackedVec3f > input, const AffineTransform3f &transform, std::span< gpu::Float3Slot16 > output) noexcept
Vec3< T > TransformPoint(const AffineTransform3< T > &transform, const Vec3< T > &point) noexcept