changes to match latest matrix/vector3 api

This commit is contained in:
h4570
2020-12-24 10:34:56 +01:00
parent 8589a298da
commit e39c8c5de8
9 changed files with 15 additions and 22 deletions
+1 -4
View File
@@ -14,12 +14,9 @@
const float CAMERA_Y = 15.0F;
Camera::Camera(ScreenSettings *t_screen) : CameraBase(t_screen, &position, &up)
Camera::Camera(ScreenSettings *t_screen) : CameraBase(t_screen, &position)
{
verticalLevel = 30.0F;
up.x = 0.0F;
up.y = 1.0F;
up.z = 0.0F;
}
Camera::~Camera() {}
+1 -2
View File
@@ -22,7 +22,7 @@ class Camera : public CameraBase
{
public:
Vector3 position,up, unitCirclePosition;
Vector3 position, up, unitCirclePosition;
float horizontalLevel, verticalLevel;
Camera(ScreenSettings *t_screen);
@@ -34,7 +34,6 @@ public:
protected:
Vector3 *getPosition() { return &position; };
Vector3 *getUp() { return &up; };
ScreenSettings screen;
};
+1 -4
View File
@@ -19,13 +19,10 @@ const float CAMERA_Y = 30.0F;
// Constructors/Destructors
// ----
Camera::Camera(ScreenSettings *t_screen) : CameraBase(t_screen, &position, &up)
Camera::Camera(ScreenSettings *t_screen) : CameraBase(t_screen, &position)
{
PRINT_LOG("Initializing camera");
verticalLevel = 80.0F;
up.x = 0.0F;
up.y = 1.0F;
up.z = 0.0F;
PRINT_LOG("Camera initialized!");
}
-1
View File
@@ -35,7 +35,6 @@ public:
protected:
Vector3 *getPosition() { return &position; };
Vector3 *getUp() { return &up; };
ScreenSettings screen;
};
+2 -2
View File
@@ -211,13 +211,13 @@ FloorsCheck *Player::checkFloors(const FloorManager &t_floorManager, const Vecto
for (u32 i = 0; i < t_floorManager.floorAmount; i++)
{
Utils::getMinMax(t_floorManager.floors[i].mesh, min, max);
if (result->currentFloor == NULL && this->mesh.position.isOnSquare(min, max))
if (result->currentFloor == NULL && this->mesh.position.isOnBox(min, max))
{
result->currentFloor = &t_floorManager.floors[i];
result->currFloorMin.set(min);
result->currFloorMax.set(max);
}
if (result->willCollideFloor == NULL && t_nextPos.collidesSquare(min, max))
if (result->willCollideFloor == NULL && t_nextPos.collidesBox(min, max))
{
result->willCollideFloor = &t_floorManager.floors[i];
result->willCollideFloorMin.set(min);