A common interface for Camera2D and Camera3D. More...
Public Member Functions | |
void | SetAspectFromViewport () |
Read aspect ratio from viewport and update camera projection data accordingly. | |
void | Push () |
Push all matrices on the stack, and set Projection and View. | |
void | Pop () |
Pop all matrices from the stack. | |
Matrix4 | GetTransform () |
Return the camera transform matrix (orthonormal positioning matrix), as a Matrix4. | |
void | DebugDraw (float step) |
Draw a world grid and the world coordinate system, for debug. | |
void | Navigate (int control) |
Process input for debug navigation. | |
void | SetViewFromViewport () |
Set a camera view so that the bottom left of the screen matches world point (0,0) and the top right of the screen matches world point (screen width, sreen height). | |
Vector2 | NormalizedToWorld (Vector2 bottom_left_minus_1_minus_1_top_left_1_1_normalized_screen_pos) |
Given a point in normalized screen coordinates (-1->1), return its corresponding world position. | |
Vector2 | GetTouchPos (int nth=0, bool prev=false) |
Return the 'nth' touch position in world coordinates. | |
Bounds2 | CalcBounds () |
Calculate the world bounds currently visible on screen. | |
float | GetPixelSize () |
Based on current viewport size, get the size of a "screen pixel" in world coordinates. | |
void | SetTouchPlaneMatrix (Matrix4 mat) |
The the orientation of the 3D plane that should be used by GetTouchPos(). |
Bounds2 CalcBounds | ( | ) |
void DebugDraw | ( | float | step | ) |
Draw a world grid and the world coordinate system, for debug.
Note that DebugDraw() doesn't call Push()/Pop() internally. It is your responsability to call it between this Camera's Push()/Pop().
float GetPixelSize | ( | ) |
Vector2 GetTouchPos | ( | int | nth = 0 , |
bool | prev = false |
||
) |
Matrix4 GetTransform | ( | ) |
Return the camera transform matrix (orthonormal positioning matrix), as a Matrix4.
GetTransform().InverseOrthonormal() is what you push on the view matrix stack.
void SetTouchPlaneMatrix | ( | Matrix4 | mat | ) |
The the orientation of the 3D plane that should be used by GetTouchPos().
3D only.