Skip to content

Commit

Permalink
Auto-update from libvoxelstorm: latest vectorstorm from emscripten ch…
Browse files Browse the repository at this point in the history
…atgpt demo (7dd26d3)
  • Loading branch information
slowriot committed Dec 6, 2024
1 parent ef90727 commit 8fd8ab1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions vectorstorm/matrix/matrix3.h
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ class matrix3wgpu {
}

/**
* Copy constructor.
* Copy constructor
* @param src Data source for new created instance of matrix3wgpu - note padding is always zeroed
*/
inline constexpr explicit matrix3wgpu(matrix3wgpu<T> const &src) noexcept __attribute__((__always_inline__))
Expand All @@ -853,22 +853,31 @@ class matrix3wgpu {
}

/**
* Move constructor.
* Move constructor
* @param src Data source for new created instance of matrix3wgpu
*/
inline constexpr matrix3wgpu(matrix3wgpu<T> &&src) noexcept __attribute__((__always_inline__))
: data(std::move(src.data)) {
}

/**
* Copy constructor from matrix3.
* Copy constructor from matrix3
* @param src Data source matrix3 for new created instance of matrix3wgpu
*/
inline constexpr explicit matrix3wgpu(matrix3<T> const &src) noexcept __attribute__((__always_inline__))
: data{src.data[0], src.data[1], src.data[2], T{0},
src.data[3], src.data[4], src.data[5], T{0},
src.data[6], src.data[7], src.data[8], T{0}} {
}

/**
* Copy operator
* @param rhs Right hand side argument of binary operator.
*/
inline matrix3wgpu<T> constexpr &operator=(matrix3wgpu<T> const &rhs) noexcept __attribute__((__always_inline__)) {
std::memcpy(data.data(), rhs.data.data(), sizeof(T) * 12);
return *this;
}
};

#ifdef VECTORSTORM_NAMESPACE
Expand Down

0 comments on commit 8fd8ab1

Please sign in to comment.