mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 17:37:09 +01:00
b82784be92
The scenery models (AnimModel.h), the sweeps (Sweep.h) and the camera
(Camera.h, which Globals.h includes) pulled in the whole vehicle header, for
one structure (material_data) and a pointer type.
- model/materialdata.h/.cpp: material_data and TextureTest(), moved from
DynObj.h/.cpp as they were
- Camera.h names TDynamicObject through utilities/Classes.h
- Classes.h includes interfaces/ITexture.h for null_handle, the value of the
handles it defines; AnimModel.h includes utilities/Names.h for basic_table
itself. Both came through DynObj.h before.
- the files that use the vehicles include vehicle/DynObj.h themselves
164 of the 730 objects of the build depend on DynObj.h now, 304 before.
No change in behaviour: 1142/1142 tests, golden traces exact against staging
62f7a29b.
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "input/command.h"
|
|
#include "utilities/Classes.h"
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
class TCamera {
|
|
|
|
public: // McZapkie: potrzebuje do kiwania na boki
|
|
void Init(glm::dvec3 const &Location, glm::dvec3 const &Angle, TDynamicObject *Owner);
|
|
void Reset();
|
|
void OnCursorMove(double const x, double const y);
|
|
bool OnCommand( command_data const &Command );
|
|
void Update();
|
|
bool SetMatrix(glm::dmat4 &Matrix) const;
|
|
void RaLook();
|
|
|
|
glm::vec3 Angle; // pitch, yaw, roll
|
|
glm::dvec3 Pos; // współrzędne obserwatora
|
|
glm::dvec3 LookAt; // Idealnie gdyby był to znormalizowany kierunek, ale obecnie są to współrzędne punktu, na który ma patrzeć
|
|
glm::vec3 vUp;
|
|
glm::dvec3 Velocity;
|
|
|
|
TDynamicObject *m_owner { nullptr }; // TODO: change to const when shake calculations are part of vehicles update
|
|
glm::vec3 m_owneroffset{};
|
|
|
|
private:
|
|
glm::dvec3 m_moverate;
|
|
glm::vec3 m_rotationoffsets; // requested changes to pitch, yaw and roll
|
|
|
|
};
|
|
|
|
struct viewport_proj_config {
|
|
glm::vec3 pa; // screen lower left corner
|
|
glm::vec3 pb; // screen lower right corner
|
|
glm::vec3 pc; // screen upper left corner
|
|
glm::vec3 pe; // eye position
|
|
};
|