Skip to content

Commit

Permalink
Improve structure of math namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
cjhoward committed Dec 9, 2023
1 parent 6a3878f commit 83676be
Show file tree
Hide file tree
Showing 84 changed files with 1,151 additions and 1,087 deletions.
2 changes: 1 addition & 1 deletion src/engine/ai/steering/behavior/flee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include <engine/ai/steering/behavior/flee.hpp>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>

namespace ai {
namespace steering {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/ai/steering/behavior/seek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include <engine/ai/steering/behavior/seek.hpp>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>

namespace ai {
namespace steering {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/ai/steering/behavior/wander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <engine/ai/steering/behavior/wander.hpp>
#include <engine/ai/steering/behavior/seek.hpp>
#include <array>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>
#include <engine/math/quaternion.hpp>

namespace ai {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/animation/ease.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#ifndef ANTKEEPER_EASE_HPP
#define ANTKEEPER_EASE_HPP

#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>
#include <cmath>

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <engine/animation/ik/ik-constraint.hpp>
#include <engine/math/euler-angles.hpp>
#include <engine/math/numbers.hpp>
#include <engine/math/constants.hpp>

/**
* Euler angle IK constraint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define ANTKEEPER_ANIMATION_SWING_TWIST_IK_CONSTRAINT_HPP

#include <engine/animation/ik/ik-constraint.hpp>
#include <engine/math/numbers.hpp>
#include <engine/math/constants.hpp>

/**
* IK constraint with cone-limited swing and angle-limited twist.
Expand Down
2 changes: 1 addition & 1 deletion src/engine/animation/locomotion/gait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include <engine/animation/locomotion/gait.hpp>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>
#include <cmath>

float gait::phase(float t) const noexcept
Expand Down
2 changes: 1 addition & 1 deletion src/engine/animation/locomotion/step.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include <engine/animation/locomotion/step.hpp>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>
#include <cmath>

float step::phase(float t) const noexcept
Expand Down
2 changes: 1 addition & 1 deletion src/engine/app/sdl/sdl-input-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <engine/input/application-events.hpp>
#include <engine/input/input-update-event.hpp>
#include <engine/debug/log.hpp>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>
#include <SDL2/SDL.h>
#include <stdexcept>

Expand Down
2 changes: 1 addition & 1 deletion src/engine/geom/brep/brep-attribute-map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class brep_attribute_map
*
* @return Reference to the attribute with the given name.
*
* @except std::out_of_range B-rep attribute not found.
* @exception std::out_of_range B-rep attribute not found.
*/
/// @{
template <class T>
Expand Down
2 changes: 1 addition & 1 deletion src/engine/geom/primitives/hypersphere.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef ANTKEEPER_GEOM_PRIMITIVES_HYPERSPHERE_HPP
#define ANTKEEPER_GEOM_PRIMITIVES_HYPERSPHERE_HPP

#include <engine/math/numbers.hpp>
#include <engine/math/constants.hpp>
#include <engine/math/vector.hpp>

namespace geom {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/geom/solid-angle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef ANTKEEPER_GEOM_SOLID_ANGLE_HPP
#define ANTKEEPER_GEOM_SOLID_ANGLE_HPP

#include <engine/math/numbers.hpp>
#include <engine/math/constants.hpp>
#include <cmath>

namespace geom {
Expand Down
18 changes: 9 additions & 9 deletions src/engine/gl/image-view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ class image_view
* @param array_layer Number of array layers accessible to the view.
* @param flags Image view flags.
*
* @except std::invalid_argument Image view has null image.
* @except std::invalid_argument Image view has unsupported format.
* @except std::invalid_argument Image view has zero mip levels.
* @except std::out_of_range Image view mip range out of image mip range.
* @except std::invalid_argument Image view has zero array layers.
* @except std::out_of_range Image view array layer range out of image array layer range.
* @except std::invalid_argument Image view dimensionality must match image dimensionality.
* @except std::invalid_argument Cube image views must be constructed from cube-compatible images.
* @except std::invalid_argument Cube image views array layer count must be a multiple of 6.
* @exception std::invalid_argument Image view has null image.
* @exception std::invalid_argument Image view has unsupported format.
* @exception std::invalid_argument Image view has zero mip levels.
* @exception std::out_of_range Image view mip range out of image mip range.
* @exception std::invalid_argument Image view has zero array layers.
* @exception std::out_of_range Image view array layer range out of image array layer range.
* @exception std::invalid_argument Image view dimensionality must match image dimensionality.
* @exception std::invalid_argument Cube image views must be constructed from cube-compatible images.
* @exception std::invalid_argument Cube image views array layer count must be a multiple of 6.
*/
image_view
(
Expand Down
32 changes: 16 additions & 16 deletions src/engine/gl/image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class image
* @param format Format of the image data.
* @param data Buffer into which image data will be read.
*
* @except std::out_of_range Image read operation mip level out of range.
* @except std::invalid_argument Image read operation used unsupported format.
* @exception std::out_of_range Image read operation mip level out of range.
* @exception std::invalid_argument Image read operation used unsupported format.
*/
void read
(
Expand Down Expand Up @@ -70,9 +70,9 @@ class image
* @param format Format of the image data.
* @param data Image data to write.
*
* @except std::out_of_range Image write operation mip level out of range.
* @except std::invalid_argument Image write operation used unsupported format.
* @except std::out_of_range Image write operation exceeded image bounds.
* @exception std::out_of_range Image write operation mip level out of range.
* @exception std::invalid_argument Image write operation used unsupported format.
* @exception std::out_of_range Image write operation exceeded image bounds.
*/
void write
(
Expand Down Expand Up @@ -197,17 +197,17 @@ class image
* @param array_layers Number of layers in the image.
* @param flags Image flags.
*
* @except std::invalid_argument Image constructed with unsupported format.
* @except std::invalid_argument Image dimensions must be nonzero.
* @except std::invalid_argument Image mip levels must be nonzero.
* @except std::out_of_range Image mip levels exceed `1 + log2(max(width, height, depth))`.
* @except std::invalid_argument Image array layers must be nonzero.
* @except std::invalid_argument 1D image must have a height and depth of `1`.
* @except std::invalid_argument 2D image must have a depth of `1`.
* @except std::invalid_argument 3D image arrays not supported.
* @except std::invalid_argument Cube compatible image must be 2D.
* @except std::invalid_argument Cube compatible image width and height must be equal.
* @except std::invalid_argument Cube compatible image array layers must be a multiple of 6.
* @exception std::invalid_argument Image constructed with unsupported format.
* @exception std::invalid_argument Image dimensions must be nonzero.
* @exception std::invalid_argument Image mip levels must be nonzero.
* @exception std::out_of_range Image mip levels exceed `1 + log2(max(width, height, depth))`.
* @exception std::invalid_argument Image array layers must be nonzero.
* @exception std::invalid_argument 1D image must have a height and depth of `1`.
* @exception std::invalid_argument 2D image must have a depth of `1`.
* @exception std::invalid_argument 3D image arrays not supported.
* @exception std::invalid_argument Cube compatible image must be 2D.
* @exception std::invalid_argument Cube compatible image width and height must be equal.
* @exception std::invalid_argument Cube compatible image array layers must be a multiple of 6.
*/
image
(
Expand Down
4 changes: 2 additions & 2 deletions src/engine/gl/pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class pipeline
* @param first_viewport Index of the first viewport to set.
* @param viewports Sequence of viewports.
*
* @except std::out_of_range Viewport index out of range.
* @exception std::out_of_range Viewport index out of range.
*
* @warning Currently only a single viewport is supported.
*/
Expand All @@ -109,7 +109,7 @@ class pipeline
* @param first_scissor Index of the first scissor region to set.
* @param scissors Sequence of scissor regions.
*
* @except std::out_of_range Scissor region index out of range.
* @exception std::out_of_range Scissor region index out of range.
*
* @warning Currently only a single scissor region is supported.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/engine/gl/vertex-array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class vertex_array
*
* @param attributes Vertex input attributes.
*
* @except std::invalid_argument Vertex input attribute has unsupported format.
* @exception std::invalid_argument Vertex input attribute has unsupported format.
*/
/// @{
explicit vertex_array(std::span<const vertex_input_attribute> attributes);
Expand Down
14 changes: 7 additions & 7 deletions src/engine/gl/vertex-buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class vertex_buffer
* @param size Buffer size, in bytes.
* @param data Buffer data. If empty, buffer data will not be set.
*
* @except std::out_of_range Vertex buffer construct operation exceeded data bounds.
* @exception std::out_of_range Vertex buffer construct operation exceeded data bounds.
*/
/// @{
vertex_buffer(buffer_usage usage, std::size_t size, std::span<const std::byte> data = {});
Expand Down Expand Up @@ -79,7 +79,7 @@ class vertex_buffer
* @param size New buffer size, in bytes.
* @param data New buffer data. If empty, buffer data will not be updated.
*
* @except std::out_of_range Vertex buffer resize operation exceeded data bounds.
* @exception std::out_of_range Vertex buffer resize operation exceeded data bounds.
*/
/// @{
void repurpose(buffer_usage usage, std::size_t size, std::span<const std::byte> data = {});
Expand All @@ -101,7 +101,7 @@ class vertex_buffer
* @param size New buffer size, in bytes.
* @param data New buffer data. If empty, buffer data will not be updated.
*
* @except std::out_of_range Vertex buffer resize operation exceeded data bounds.
* @exception std::out_of_range Vertex buffer resize operation exceeded data bounds.
*/
/// @{
inline void resize(std::size_t size, std::span<const std::byte> data = {})
Expand All @@ -121,7 +121,7 @@ class vertex_buffer
* @param offset Offset into the buffer's data, in bytes, where writing will begin.
* @param data Data to write into the buffer.
*
* @except std::out_of_range Vertex buffer write operation exceeded buffer bounds.
* @exception std::out_of_range Vertex buffer write operation exceeded buffer bounds.
*/
/// @{
void write(std::size_t offset, std::span<const std::byte> data);
Expand All @@ -138,7 +138,7 @@ class vertex_buffer
* @param offset Offset into the buffer's data, in bytes, where reading will begin.
* @param data Data buffer where the read bytes will be stored.
*
* @except std::out_of_range Vertex buffer read operation exceeded buffer bounds.
* @exception std::out_of_range Vertex buffer read operation exceeded buffer bounds.
*/
/// @{
void read(std::size_t offset, std::span<std::byte> data) const;
Expand All @@ -157,8 +157,8 @@ class vertex_buffer
* @param read_offset Offset into the read buffer's data, in bytes, where reading will begin.
* @param write_offset Offset into the this buffer's data, in bytes, where writing will begin.
*
* @except std::out_of_range Vertex buffer copy operation exceeded read buffer bounds.
* @except std::out_of_range Vertex buffer copy operation exceeded write buffer bounds.
* @exception std::out_of_range Vertex buffer copy operation exceeded read buffer bounds.
* @exception std::out_of_range Vertex buffer copy operation exceeded write buffer bounds.
*/
void copy(const vertex_buffer& read_buffer, std::size_t copy_size, std::size_t read_offset = 0, std::size_t write_offset = 0);

Expand Down
3 changes: 3 additions & 0 deletions src/engine/hash/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
// export import hash.make_uint;
// export import hash.pcg;

/// Hash functions.
namespace hash {}

#endif // ANTKEEPER_HASH_HPP
2 changes: 1 addition & 1 deletion src/engine/input/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include <engine/input/gamepad.hpp>
#include <engine/math/common.hpp>
#include <engine/math/functions.hpp>
#include <algorithm>
#include <type_traits>
#include <cmath>
Expand Down
Loading

0 comments on commit 83676be

Please sign in to comment.