diff options
| author | Juan Linietsky | 2016-11-09 23:55:06 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-11-09 23:55:06 -0300 |
| commit | cacf9ebb7fd8df8845daca9da2fe55456cc179aa (patch) | |
| tree | 5881cb42ace5001916e9d1843f5a7acbc35332a6 /core/math/camera_matrix.cpp | |
| parent | 6b2a27bbe5fa112365fc88b9b4678a61293bcb53 (diff) | |
| download | godot-cacf9ebb7fd8df8845daca9da2fe55456cc179aa.tar.gz godot-cacf9ebb7fd8df8845daca9da2fe55456cc179aa.tar.zst godot-cacf9ebb7fd8df8845daca9da2fe55456cc179aa.zip | |
Diffstat (limited to 'core/math/camera_matrix.cpp')
| -rw-r--r-- | core/math/camera_matrix.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index f7dd8839b..3e3cd1af4 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -495,6 +495,28 @@ void CameraMatrix::set_light_bias() { } +void CameraMatrix::set_light_atlas_rect(const Rect2& p_rect) { + + float *m=&matrix[0][0]; + + m[0]=p_rect.size.width, + m[1]=0.0, + m[2]=0.0, + m[3]=0.0, + m[4]=0.0, + m[5]=p_rect.size.height, + m[6]=0.0, + m[7]=0.0, + m[8]=0.0, + m[9]=0.0, + m[10]=1.0, + m[11]=0.0, + m[12]=p_rect.pos.x, + m[13]=p_rect.pos.y, + m[14]=0.0, + m[15]=1.0; +} + CameraMatrix::operator String() const { String str; |
