fixed frustum culling, static game class

This commit is contained in:
Sandro Sobczyński
2020-11-04 13:20:58 +01:00
parent 5399b1744f
commit 02560f2d6f
19 changed files with 73 additions and 70 deletions
+3 -3
View File
@@ -187,8 +187,8 @@ void Matrix::setPerspective(ScreenSettings &t_screen)
{
float fovYdiv2 = Math::HALF_ANG2RAD * t_screen.fov;
float cotFOV = 1.0F / (Math::sin(fovYdiv2) / Math::cos(fovYdiv2));
float w = cotFOV * (t_screen.width / 4096.0F) / t_screen.aspectRatio;
float h = cotFOV * (t_screen.height / 4096.0F);
float w = cotFOV * (t_screen.width / t_screen.projectionScale) / t_screen.aspectRatio;
float h = cotFOV * (t_screen.height / t_screen.projectionScale);
this->data[0] = w;
this->data[1] = 0.0F;
@@ -253,7 +253,7 @@ void Matrix::lookAt(Vector3 &t_up, Vector3 &t_position, Vector3 &t_target)
data[15] = 1;
}
void Matrix::print()
const void Matrix::print() const
{
printf("MATRIX(\n%f, %f, %f, %f\n%f, %f, %f, %f\n%f, %f, %f, %f\n%f, %f, %f, %f\n)\n",
data[0], data[1], data[2], data[3],
+1 -1
View File
@@ -44,7 +44,7 @@ void Plane::update(Vector3 &a, Vector3 &b, Vector3 &c)
this->distance = -this->normal.innerProduct(b);
}
void Plane::print()
const void Plane::print() const
{
printf("Plane(Vector3(%f, %f, %f), %f)\n", this->normal.x, this->normal.y, this->normal.z, this->distance);
}
+1 -1
View File
@@ -55,7 +55,7 @@ void Point::set(const Point &v)
y = v.y;
}
void Point::print()
const void Point::print() const
{
printf("Point(%f, %f)\n", x, y);
}
+1 -1
View File
@@ -295,7 +295,7 @@ float Vector3::distanceTo(Vector3 &v)
// (this->z - another.z) * (this->z - another.z));
}
void Vector3::print()
const void Vector3::print() const
{
printf("Vector3(%f, %f, %f)\n", x, y, z);
}