tutorial 04

This commit is contained in:
h4570
2022-08-22 23:23:51 +02:00
parent 4fa65fc535
commit d469e78747
26 changed files with 400 additions and 96 deletions
+44
View File
@@ -0,0 +1,44 @@
/*
# _____ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licensed under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tyra>
namespace Tyra {
class Camera {
public:
Camera(Pad* pad);
~Camera();
Vec4 lookAt;
Vec4 position;
/**
* Result variable of unit circle calculation
* This is needed for rotation about the camera lookAt
* https://www.geogebra.org/m/cNEtsbvC
*/
Vec4 unitCircle;
CameraInfo3D getCameraInfo() { return CameraInfo3D(&position, &lookAt); }
void update();
private:
void updatePosition();
void updateLookAt();
Pad* pad;
float circleRotation, circleLength, speed, lookAtHeight;
};
} // namespace Tyra