Blender V5.3
gpu_matrix.cc File Reference

Go to the source code of this file.

Classes

struct  blender::MatrixStack
struct  blender::GPUMatrixState

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define SUPPRESS_GENERIC_MATRIX_API
#define USE_GPU_PY_MATRIX_API
#define ModelViewStack   Context::get()->matrix_state->model_view_stack
#define ModelView   ModelViewStack.stack[ModelViewStack.top]
#define ProjectionStack   Context::get()->matrix_state->projection_stack
#define Projection   ProjectionStack.stack[ProjectionStack.top]
#define MATRIX_4X4_IDENTITY
#define CHECKMAT(m)

Typedefs

using blender::Mat4 = float[4][4]
using blender::Mat3 = float[3][3]

Functions

GPUMatrixState * blender::GPU_matrix_state_create ()
void blender::GPU_matrix_state_discard (GPUMatrixState *state)
static void blender::gpu_matrix_state_active_set_dirty (bool value)
void blender::GPU_matrix_reset ()
void blender::GPU_matrix_push ()
void blender::GPU_matrix_pop ()
void blender::GPU_matrix_push_projection ()
void blender::GPU_matrix_pop_projection ()
void blender::GPU_matrix_set (const float m[4][4])
void blender::GPU_matrix_identity_projection_set ()
void blender::GPU_matrix_projection_set (const float m[4][4])
void blender::GPU_matrix_identity_set ()
void blender::GPU_matrix_translate_2f (float x, float y)
void blender::GPU_matrix_translate_2fv (const float vec[2])
void blender::GPU_matrix_translate_3f (float x, float y, float z)
void blender::GPU_matrix_translate_3fv (const float vec[3])
void blender::GPU_matrix_scale_1f (float factor)
void blender::GPU_matrix_scale_2f (float x, float y)
void blender::GPU_matrix_scale_2fv (const float vec[2])
void blender::GPU_matrix_scale_3f (float x, float y, float z)
void blender::GPU_matrix_scale_3fv (const float vec[3])
void blender::GPU_matrix_mul (const float m[4][4])
void blender::GPU_matrix_rotate_2d (float deg)
void blender::GPU_matrix_rotate_3f (float deg, float x, float y, float z)
void blender::GPU_matrix_rotate_3fv (float deg, const float axis[3])
void blender::GPU_matrix_rotate_axis (float deg, char axis)
static void blender::mat4_ortho_set (float m[4][4], float left, float right, float bottom, float top, float near, float far)
static void blender::mat4_frustum_set (float m[4][4], float left, float right, float bottom, float top, float near, float far)
static void blender::mat4_look_from_origin (float m[4][4], float lookdir[3], float camup[3])
void blender::GPU_matrix_ortho_set (float left, float right, float bottom, float top, float near, float far)
void blender::GPU_matrix_ortho_set_z (float near, float far)
void blender::GPU_matrix_ortho_2d_set (float left, float right, float bottom, float top)
void blender::GPU_matrix_frustum_set (float left, float right, float bottom, float top, float near, float far)
void blender::GPU_matrix_perspective_set (float fovy, float aspect, float near, float far)
void blender::GPU_matrix_look_at (float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
void blender::GPU_matrix_project_3fv (const float world[3], const float model[4][4], const float proj[4][4], const int view[4], float r_win[3])
void blender::GPU_matrix_project_2fv (const float world[3], const float model[4][4], const float proj[4][4], const int view[4], float r_win[2])
bool blender::GPU_matrix_unproject_3fv (const float win[3], const float model_inverted[4][4], const float proj[4][4], const int view[4], float r_world[3])
const float(* blender::GPU_matrix_model_view_get (float m[4][4]))[4]
const float(* blender::GPU_matrix_projection_get (float m[4][4]))[4]
const float(* blender::GPU_matrix_model_view_projection_get (float m[4][4]))[4]
const float(* blender::GPU_matrix_normal_get (float m[3][3]))[3]
const float(* blender::GPU_matrix_normal_inverse_get (float m[3][3]))[3]
void blender::GPU_matrix_bind (gpu::Shader *shader)
bool blender::GPU_matrix_dirty_get ()
Python API Helpers
 blender::BLI_STATIC_ASSERT (GPU_PY_MATRIX_STACK_LEN+1==MATRIX_STACK_DEPTH, "define mismatch")
int blender::GPU_matrix_stack_level_get_model_view ()
int blender::GPU_matrix_stack_level_get_projection ()
Polygon Offset Hack

Workaround the fact that polygon-offset is implementation dependent. We modify the projection matrix winmat in order to change the final depth a tiny amount.

float blender::GPU_polygon_offset_calc (const float(*winmat)[4], float viewdist, float dist)
void blender::GPU_polygon_offset (float viewdist, float dist)

Variables

static constexpr int blender::MATRIX_STACK_DEPTH = 32

Macro Definition Documentation

◆ CHECKMAT

◆ MATRIX_4X4_IDENTITY

#define MATRIX_4X4_IDENTITY
Value:
{ \
{1.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f, 0.0f}, \
{0.0f, 0.0f, 0.0f, 1.0f} \
}

Referenced by blender::GPU_matrix_state_create().

◆ ModelView

◆ ModelViewStack

#define ModelViewStack   Context::get()->matrix_state->model_view_stack

Definition at line 51 of file gpu_matrix.cc.

Referenced by blender::GPU_matrix_pop(), and blender::GPU_matrix_push().

◆ Projection

◆ ProjectionStack

#define ProjectionStack   Context::get()->matrix_state->projection_stack

◆ SUPPRESS_GENERIC_MATRIX_API

#define SUPPRESS_GENERIC_MATRIX_API

Definition at line 12 of file gpu_matrix.cc.

◆ USE_GPU_PY_MATRIX_API

#define USE_GPU_PY_MATRIX_API

Definition at line 13 of file gpu_matrix.cc.