mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
rebranding moment
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
target_sources(uml PRIVATE
|
||||
target_sources(omath PRIVATE
|
||||
Vector3.cpp
|
||||
matrix.cpp
|
||||
angles.cpp
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// Created by vlad on 10/28/23.
|
||||
//
|
||||
|
||||
#include <uml/Vector3.h>
|
||||
#include <omath/Vector3.h>
|
||||
#include <cmath>
|
||||
#include <uml/angles.h>
|
||||
#include <omath/angles.h>
|
||||
|
||||
namespace uml
|
||||
namespace omath
|
||||
{
|
||||
bool Vector3::operator==(const Vector3 &src) const
|
||||
{
|
||||
@@ -211,6 +211,35 @@ namespace uml
|
||||
};
|
||||
}
|
||||
|
||||
Vector3 Vector3::ForwardVector(const float pitch, const float yaw)
|
||||
{
|
||||
const auto cosPitch = std::cos(angles::DegreesToRadians(pitch));
|
||||
const auto sinPitch = std::sin(angles::DegreesToRadians(pitch));
|
||||
|
||||
const auto cosYaw = std::cos(angles::DegreesToRadians(yaw));
|
||||
const auto sinYaw = std::sin(angles::DegreesToRadians(yaw));
|
||||
|
||||
|
||||
return {cosPitch*cosYaw, cosPitch*sinYaw, sinPitch};
|
||||
}
|
||||
|
||||
Vector3 Vector3::RightVector(const float pitch, const float yaw, const float roll)
|
||||
{
|
||||
const auto cosPitch = std::cos(angles::DegreesToRadians(pitch));
|
||||
const auto sinPitch = std::sin(angles::DegreesToRadians(pitch));
|
||||
|
||||
const auto cosYaw = std::cos(angles::DegreesToRadians(yaw));
|
||||
const auto sinYaw = std::sin(angles::DegreesToRadians(yaw));
|
||||
|
||||
const auto cosRoll = std::cos(angles::DegreesToRadians(yaw));
|
||||
const auto sinRoll = std::sin(angles::DegreesToRadians(yaw));
|
||||
|
||||
|
||||
return {-sinRoll*sinPitch*cosYaw + -cosRoll*-sinYaw,
|
||||
-sinRoll*sinPitch*sinYaw + -cosRoll*cosYaw,
|
||||
sinRoll*cosPitch};
|
||||
}
|
||||
|
||||
Vector3 Vector3::Cross(const Vector3 &v) const
|
||||
{
|
||||
return {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Vector4.cpp
|
||||
//
|
||||
|
||||
#include "uml/Vector4.h"
|
||||
#include "omath/Vector4.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
namespace uml
|
||||
namespace omath
|
||||
{
|
||||
bool Vector4::operator==(const Vector4& src) const
|
||||
{
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
// Created by vlad on 11/6/23.
|
||||
//
|
||||
|
||||
#include "uml/angles.h"
|
||||
#include "omath/angles.h"
|
||||
#include <numbers>
|
||||
|
||||
|
||||
namespace uml::angles
|
||||
namespace omath::angles
|
||||
{
|
||||
float RadiansToDegrees(const float radiands)
|
||||
constexpr float RadiansToDegrees(const float radiands)
|
||||
{
|
||||
return radiands * (180.f / std::numbers::pi_v<float>);
|
||||
}
|
||||
|
||||
float DegreesToRadians(const float degrees)
|
||||
constexpr float DegreesToRadians(const float degrees)
|
||||
{
|
||||
return degrees * (std::numbers::pi_v<float> / 180.f);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// Created by vlad on 2/4/24.
|
||||
//
|
||||
|
||||
#include "uml/color.h"
|
||||
#include "omath/color.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
namespace uml::color
|
||||
namespace omath::color
|
||||
{
|
||||
Vector3 Blend(const Vector3 &first, const Vector3 &second, float ratio)
|
||||
{
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
* Created by Alpatov Softworks with love in Russia.
|
||||
*/
|
||||
|
||||
#include "uml/matrix.h"
|
||||
#include "omath/matrix.h"
|
||||
|
||||
#include <format>
|
||||
|
||||
#include "uml/Vector3.h"
|
||||
#include "omath/Vector3.h"
|
||||
#include <utility>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
|
||||
namespace uml
|
||||
namespace omath
|
||||
{
|
||||
matrix::matrix(const size_t rows, const size_t columns)
|
||||
{
|
||||
|
||||
@@ -1 +1 @@
|
||||
target_sources(uml PRIVATE Engine.cpp Projectile.cpp Target.cpp)
|
||||
target_sources(omath PRIVATE Engine.cpp Projectile.cpp Target.cpp)
|
||||
@@ -3,15 +3,15 @@
|
||||
//
|
||||
|
||||
|
||||
#include "uml/prediction/Engine.h"
|
||||
#include "omath/prediction/Engine.h"
|
||||
#include <cmath>
|
||||
#include <uml/angles.h>
|
||||
#include <omath/angles.h>
|
||||
|
||||
|
||||
namespace uml::prediction
|
||||
namespace omath::prediction
|
||||
{
|
||||
Engine::Engine(const float gravityConstant, const float simulationTimeStep,
|
||||
const float maximumSimulationTime, float distanceTolerance)
|
||||
const float maximumSimulationTime, const float distanceTolerance)
|
||||
: m_gravityConstant(gravityConstant),
|
||||
m_simulationTimeStep(simulationTimeStep),
|
||||
m_maximumSimulationTime(maximumSimulationTime),
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#include "uml/prediction/Projectile.h"
|
||||
#include "omath/prediction/Projectile.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
namespace uml::prediction
|
||||
namespace omath::prediction
|
||||
{
|
||||
Vector3 Projectile::CalculateVelocity(const float pitch, const float yaw) const
|
||||
{
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// Created by Vlad on 6/9/2024.
|
||||
//
|
||||
|
||||
#include "uml/prediction/Target.h"
|
||||
#include "omath/prediction/Target.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
namespace uml::prediction
|
||||
namespace omath::prediction
|
||||
{
|
||||
Vector3 Target::PredictPosition(const float time, const float gravity) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user