mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-24 10:07:17 +01:00
Added simple scaling for uvs for TiledWalls.
This commit is contained in:
parent
1a7c404a17
commit
068143691c
@ -680,15 +680,17 @@ void PropMesher::add_tiled_wall_simple(const int width, const int height, const
|
|||||||
|
|
||||||
void PropMesher::add_tiled_wall_mesh_rect_simple(const float x, const float y, const float y_size, const float prev_z_offset, const float current_z_offset, const Transform &transform, const Rect2 &texture_rect, const int texture_scale) {
|
void PropMesher::add_tiled_wall_mesh_rect_simple(const float x, const float y, const float y_size, const float prev_z_offset, const float current_z_offset, const Transform &transform, const Rect2 &texture_rect, const int texture_scale) {
|
||||||
int vc = get_vertex_count();
|
int vc = get_vertex_count();
|
||||||
|
|
||||||
|
float cy = CLAMP(0.0, 1.0, y_size);
|
||||||
|
|
||||||
//x + 1, y
|
//x + 1, y
|
||||||
add_normal(transform.basis.xform(Vector3(0, 0, -1)));
|
add_normal(transform.basis.xform(Vector3(0, 0, -1)));
|
||||||
add_uv(transform_uv_scaled(Vector2(1, 1), texture_rect, x, y, texture_scale));
|
add_uv(transform_uv_scaled(Vector2(1, cy), texture_rect, x, y, texture_scale));
|
||||||
add_vertex(transform.xform(Vector3(x + 1, y, prev_z_offset)));
|
add_vertex(transform.xform(Vector3(x + 1, y, prev_z_offset)));
|
||||||
|
|
||||||
//x, y
|
//x, y
|
||||||
add_normal(transform.basis.xform(Vector3(0, 0, -1)));
|
add_normal(transform.basis.xform(Vector3(0, 0, -1)));
|
||||||
add_uv(transform_uv_scaled(Vector2(0, 1), texture_rect, x, y, texture_scale));
|
add_uv(transform_uv_scaled(Vector2(0, cy), texture_rect, x, y, texture_scale));
|
||||||
add_vertex(transform.xform(Vector3(x, y, prev_z_offset)));
|
add_vertex(transform.xform(Vector3(x, y, prev_z_offset)));
|
||||||
|
|
||||||
//x, y + 1
|
//x, y + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user