- 新增Math库: Vector2/3/4, Matrix3/4, Quaternion, Transform, Color等 - 新增测试框架: Google Test (gtest) - 新增140个单元测试,覆盖Vector, Matrix, Quaternion, Geometry - VolumeRenderer支持vcpkg的NanoVDB - 添加TESTING.md测试文档
32 lines
745 B
C++
32 lines
745 B
C++
#pragma once
|
|
|
|
#include "Math.h"
|
|
#include "Vector3.h"
|
|
#include "Quaternion.h"
|
|
#include "Matrix4.h"
|
|
|
|
namespace XCEngine {
|
|
namespace Math {
|
|
|
|
enum class Space {
|
|
Self,
|
|
World
|
|
};
|
|
|
|
struct Transform {
|
|
Vector3 position = Vector3::Zero();
|
|
Quaternion rotation = Quaternion::Identity();
|
|
Vector3 scale = Vector3::One();
|
|
|
|
Matrix4 ToMatrix() const;
|
|
Transform Inverse() const;
|
|
Transform operator*(const Transform& other) const;
|
|
Vector3 TransformPoint(const Vector3& point) const;
|
|
Vector3 TransformDirection(const Vector3& direction) const;
|
|
Vector3 InverseTransformPoint(const Vector3& point) const;
|
|
Vector3 InverseTransformDirection(const Vector3& direction) const;
|
|
};
|
|
|
|
} // namespace Math
|
|
} // namespace XCEngine
|