Public updated property for camera class
This commit is contained in:
parent
2d3babb45a
commit
f5ba1e8939
2 changed files with 6 additions and 1 deletions
|
|
@ -37,6 +37,8 @@ private:
|
||||||
{
|
{
|
||||||
matrices.view = transM * rotM;
|
matrices.view = transM * rotM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updated = true;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
enum CameraType { lookat, firstperson };
|
enum CameraType { lookat, firstperson };
|
||||||
|
|
@ -48,6 +50,8 @@ public:
|
||||||
float rotationSpeed = 1.0f;
|
float rotationSpeed = 1.0f;
|
||||||
float movementSpeed = 1.0f;
|
float movementSpeed = 1.0f;
|
||||||
|
|
||||||
|
bool updated = false;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
glm::mat4 perspective;
|
glm::mat4 perspective;
|
||||||
|
|
@ -120,6 +124,7 @@ public:
|
||||||
|
|
||||||
void update(float deltaTime)
|
void update(float deltaTime)
|
||||||
{
|
{
|
||||||
|
updated = false;
|
||||||
if (type == CameraType::firstperson)
|
if (type == CameraType::firstperson)
|
||||||
{
|
{
|
||||||
if (moving())
|
if (moving())
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ private:
|
||||||
float fpsTimer = 0.0f;
|
float fpsTimer = 0.0f;
|
||||||
// Get window title with example name, device, et.
|
// Get window title with example name, device, et.
|
||||||
std::string getWindowTitle();
|
std::string getWindowTitle();
|
||||||
/** brief Indicates that the view (position, rotation) has changed and */
|
/** brief Indicates that the view (position, rotation) has changed and buffers containing camera matrices need to be updated */
|
||||||
bool viewUpdated = false;
|
bool viewUpdated = false;
|
||||||
// Destination dimensions for resizing the window
|
// Destination dimensions for resizing the window
|
||||||
uint32_t destWidth;
|
uint32_t destWidth;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue