Somewhat working camera
This commit is contained in:
@@ -10,51 +10,43 @@ public:
|
||||
CameraComponent();
|
||||
virtual ~CameraComponent();
|
||||
|
||||
Matrix4 getViewMatrix()
|
||||
{
|
||||
if (bNeedsViewBuild)
|
||||
{
|
||||
buildViewMatrix();
|
||||
}
|
||||
return viewMatrix;
|
||||
}
|
||||
Matrix4 getProjectionMatrix()
|
||||
{
|
||||
if (bNeedsProjectionBuild)
|
||||
{
|
||||
buildProjectionMatrix();
|
||||
}
|
||||
return projectionMatrix;
|
||||
}
|
||||
Vector getCameraPosition()
|
||||
{
|
||||
if(bNeedsViewBuild)
|
||||
{
|
||||
buildViewMatrix();
|
||||
}
|
||||
return cameraPosition;
|
||||
}
|
||||
void mouseMove(float deltaX, float deltaY);
|
||||
void mouseScroll(double x);
|
||||
void moveOrigin(float up);
|
||||
float aspectRatio;
|
||||
float fieldOfView;
|
||||
Matrix4 getViewMatrix()
|
||||
{
|
||||
if (bNeedsViewBuild)
|
||||
{
|
||||
buildViewMatrix();
|
||||
}
|
||||
return viewMatrix;
|
||||
}
|
||||
Matrix4 getProjectionMatrix()
|
||||
{
|
||||
if (bNeedsProjectionBuild)
|
||||
{
|
||||
buildProjectionMatrix();
|
||||
}
|
||||
return projectionMatrix;
|
||||
}
|
||||
Vector getCameraPosition()
|
||||
{
|
||||
return getTransform().getPosition();
|
||||
}
|
||||
void mouseMove(float deltaX, float deltaY);
|
||||
void mouseScroll(float x);
|
||||
void moveX(float amount);
|
||||
void moveY(float amount);
|
||||
float aspectRatio;
|
||||
float fieldOfView;
|
||||
private:
|
||||
bool bNeedsViewBuild;
|
||||
bool bNeedsProjectionBuild;
|
||||
void buildViewMatrix();
|
||||
void buildProjectionMatrix();
|
||||
bool bNeedsProjectionBuild;
|
||||
void buildViewMatrix();
|
||||
void buildProjectionMatrix();
|
||||
|
||||
float rotationX;
|
||||
float rotationY;
|
||||
float distance;
|
||||
|
||||
Vector eye;
|
||||
Vector originPoint;
|
||||
Vector cameraPosition;
|
||||
//Transforms relative to actor
|
||||
Matrix4 viewMatrix;
|
||||
Matrix4 projectionMatrix;
|
||||
//Transforms relative to actor
|
||||
Matrix4 viewMatrix;
|
||||
Matrix4 projectionMatrix;
|
||||
float rotationX;
|
||||
float rotationY;
|
||||
};
|
||||
DEFINE_REF(CameraComponent)
|
||||
} // namespace Seele
|
||||
|
||||
Reference in New Issue
Block a user