mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Add basic ortho and perspective projection APIs to love.graphics.
- Added love.graphics.setOrthoProjection. - Added love.graphics.setPerspectiveProjection. - Added love.graphics.resetProjection. Note that the projection is reset whenever the canvas changes.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
// LOVE
|
||||
#include "math.h"
|
||||
#include "Vector.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -88,6 +89,11 @@ public:
|
||||
**/
|
||||
const float *getElements() const;
|
||||
|
||||
void setRow(int r, const Vector4 &v);
|
||||
Vector4 getRow(int r) const;
|
||||
|
||||
void setColumn(int c, const Vector4 &v);
|
||||
Vector4 getColumn(int c) const;
|
||||
/**
|
||||
* Resets this Matrix to the identity matrix.
|
||||
**/
|
||||
@@ -222,6 +228,11 @@ public:
|
||||
**/
|
||||
static Matrix4 ortho(float left, float right, float bottom, float top, float near, float far);
|
||||
|
||||
/**
|
||||
* Creates a new perspective projection matrix.
|
||||
**/
|
||||
static Matrix4 perspective(float verticalfov, float aspect, float near, float far);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user