forked from organicmaps/organicmaps
Fixed transfer marker rotation.
This commit is contained in:
parent
24ecf8bda8
commit
2cfcb31ab6
2 changed files with 7 additions and 1 deletions
|
@ -512,6 +512,9 @@ void RouteRenderer::RenderSubrouteMarkers(SubrouteInfo const & subrouteInfo, Scr
|
|||
uniforms.SetMatrix4x4Value("modelView", mv.m_data);
|
||||
uniforms.SetFloatValue("u_routeParams", currentHalfWidth, dist);
|
||||
uniforms.SetFloatValue("u_opacity", 1.0f);
|
||||
uniforms.SetFloatValue("u_angleCosSin",
|
||||
static_cast<float>(cos(screen.GetAngle())),
|
||||
static_cast<float>(sin(screen.GetAngle())));
|
||||
|
||||
glsl::vec4 const maskColor = glsl::ToVec4(GetMaskColor(subrouteInfo.m_subroute->m_routeType,
|
||||
subrouteInfo.m_subroute->m_baseDistance,
|
||||
|
|
|
@ -6,6 +6,7 @@ uniform mat4 modelView;
|
|||
uniform mat4 projection;
|
||||
uniform mat4 pivotTransform;
|
||||
|
||||
uniform vec2 u_angleCosSin;
|
||||
uniform vec2 u_routeParams;
|
||||
|
||||
varying vec4 v_radius;
|
||||
|
@ -14,7 +15,9 @@ varying vec4 v_color;
|
|||
void main()
|
||||
{
|
||||
float r = u_routeParams.x * a_normal.z;
|
||||
vec4 radius = vec4(a_normal.xy * r, r, a_position.w);
|
||||
vec2 normal = vec2(a_normal.x * u_angleCosSin.x - a_normal.y * u_angleCosSin.y,
|
||||
a_normal.x * u_angleCosSin.y + a_normal.y * u_angleCosSin.x);
|
||||
vec4 radius = vec4(normal.xy * r, r, a_position.w);
|
||||
vec4 pos = vec4(a_position.xy, 0, 1) * modelView;
|
||||
vec2 shiftedPos = radius.xy + pos.xy;
|
||||
pos = vec4(shiftedPos, a_position.z, 1.0) * projection;
|
||||
|
|
Loading…
Add table
Reference in a new issue