From 187f95b00f126f83bf939b85ea67270d6ab9c80e Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 22 Oct 2020 21:23:35 +0800 Subject: [PATCH] add uv_scale values at TrousCreateInfo --- inc/hgl/graph/InlineGeometry.h | 2 ++ src/SceneGraph/InlineGeometry.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/hgl/graph/InlineGeometry.h b/inc/hgl/graph/InlineGeometry.h index 686482c2..987ca037 100644 --- a/inc/hgl/graph/InlineGeometry.h +++ b/inc/hgl/graph/InlineGeometry.h @@ -159,6 +159,8 @@ namespace hgl uint numberSlices, numberStacks; + + Vector2f uv_scale={1.0,1.0}; };//struct TorusCreateInfo /** diff --git a/src/SceneGraph/InlineGeometry.cpp b/src/SceneGraph/InlineGeometry.cpp index 094924ed..d1a2710c 100644 --- a/src/SceneGraph/InlineGeometry.cpp +++ b/src/SceneGraph/InlineGeometry.cpp @@ -703,8 +703,8 @@ namespace hgl if(tcp) { // generate texture coordinates and stores it in the right position - *tcp = s; ++tcp; - *tcp = t; ++tcp; + *tcp = s*tci->uv_scale.x; ++tcp; + *tcp = t*tci->uv_scale.y; ++tcp; } if(tp)