Editor use vtx collision

This commit is contained in:
MegaMech
2025-02-28 17:31:24 -07:00
parent 08f0d261d1
commit 7a31679c2d
17 changed files with 405 additions and 95 deletions
+19 -7
View File
@@ -15,13 +15,6 @@ struct FVector {
float x, y, z;
#ifdef __cplusplus
FVector& operator=(const FVector& other) {
x = other.x;
y = other.y;
z = other.z;
return *this;
}
// Operator to add two FVector objects
FVector operator+(const FVector& other) const {
return FVector(x + other.x, y + other.y, z + other.z);
@@ -32,6 +25,25 @@ struct FVector {
return FVector(x - other.x, y - other.y, z - other.z);
}
float Dot(const FVector& other) const {
return x * other.x + y * other.y + z * other.z;
}
FVector Cross(const FVector& other) const {
return FVector(
y * other.z - z * other.y,
z * other.x - x * other.z,
x * other.y - y * other.x
);
}
FVector Normalize() const {
float len = std::sqrt(x * x + y * y + z * z);
return FVector(
x / len, y / len, z / len
);
}
FVector() : x(0), y(0), z(0) {}
FVector(float x, float y, float z) : x(x), y(y), z(z) {}
#endif // __cplusplus