Redo of render paths
This commit is contained in:
@@ -3,5 +3,6 @@ target_sources(SeeleEngine
|
||||
Math.h
|
||||
Matrix.h
|
||||
Vector.h
|
||||
Vector.cpp
|
||||
Transform.h
|
||||
Transform.cpp)
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#include "Vector.h"
|
||||
#include "Matrix.h"
|
||||
#include "EngineTypes.h"
|
||||
|
||||
@@ -181,9 +181,10 @@ Transform &Transform::operator=(Transform &&other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
Transform &Transform::operator*(const Transform &other) const
|
||||
Transform &Transform::operator*(const Transform &other)
|
||||
{
|
||||
Transform outTransform;
|
||||
multiply(&outTransform, this, &other);
|
||||
return outTransform;
|
||||
*this = std::move(outTransform);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
|
||||
Transform &operator=(const Transform &other);
|
||||
Transform &operator=(Transform &&other);
|
||||
Transform &operator*(const Transform &other) const;
|
||||
Transform &operator*(const Transform &other);
|
||||
|
||||
private:
|
||||
Vector4 position;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "Vector.h"
|
||||
#include <regex>
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
Vector Seele::parseVector(const char* str)
|
||||
{
|
||||
//regex pattern consisting of 'float3(xComp, yComp, zComp)', more also matches for invalid floats, but that will throw later
|
||||
std::regex pattern("float3\\(\\s*([0-9.]+f?)\\s*,\\s*([0-9.]+f?)\\s*,\\s*([0-9.]+f?)\\s*\\)");
|
||||
std::cmatch base_match;
|
||||
std::regex_match(str, base_match, pattern);
|
||||
//match 0 is the whole expression
|
||||
float x = std::stof(base_match[1].str());
|
||||
float y = std::stof(base_match[2].str());
|
||||
float z = std::stof(base_match[3].str());
|
||||
return Vector(x, y, z);
|
||||
}
|
||||
@@ -22,6 +22,8 @@ typedef glm::ivec4 IVector4;
|
||||
|
||||
typedef glm::quat Quaternion;
|
||||
|
||||
Vector parseVector(const char*);
|
||||
|
||||
static inline float square(float x)
|
||||
{
|
||||
return x * x;
|
||||
|
||||
Reference in New Issue
Block a user