feat: sync with Whoa implementation

This commit is contained in:
VDm 2026-04-24 00:30:51 +04:00
parent 254ba545f5
commit 6a31dc3ea4
19 changed files with 988 additions and 774 deletions

View file

@ -114,7 +114,7 @@ C3Vector& C3Vector::operator/=(const C3Vector& a) {
return *this;
}
C3Vector C3Vector::operator-() {
C3Vector C3Vector::operator-() const {
return { -this->x, -this->y, -this->z };
}
@ -234,10 +234,18 @@ C3Vector operator*(float l, const C3Vector& r) {
return { l * r.x, l * r.y, l * r.z };
}
C3Vector operator*(const C3Vector& l, const C33Matrix& r) {
float x = l.x * r.a0 + l.y * r.b0 + l.z * r.c0;
float y = l.x * r.a1 + l.y * r.b1 + l.z * r.c1;
float z = l.x * r.a2 + l.y * r.b2 + l.z * r.c2;
return { x, y, z };
}
C3Vector operator*(const C3Vector& l, const C44Matrix& r) {
float x = r.c0 * l.z + r.b0 * l.y + r.a0 * l.x + r.d0;
float y = r.c1 * l.z + r.b1 * l.y + r.a1 * l.x + r.d1;
float z = r.c2 * l.z + r.b2 * l.y + r.a2 * l.x + r.d2;
float x = l.x * r.a0 + l.y * r.b0 + l.z * r.c0 + r.d0;
float y = l.x * r.a1 + l.y * r.b1 + l.z * r.c1 + r.d1;
float z = l.x * r.a2 + l.y * r.b2 + l.z * r.c2 + r.d2;
return { x, y, z };
}