@pirireis/webglobeplugins 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bearing-line/plugin.js
CHANGED
|
@@ -147,7 +147,6 @@ export default class Plugin {
|
|
|
147
147
|
'adaptor': (item) => new Float32Array([item.dashOpacity])
|
|
148
148
|
}],
|
|
149
149
|
["circleDashAngle", {
|
|
150
|
-
|
|
151
150
|
'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
152
151
|
'adaptor': (item) => new Float32Array([item.circleDashAngle / 360])
|
|
153
152
|
}]
|
package/package.json
CHANGED
|
@@ -102,22 +102,22 @@ vec3 circleLimpFromLongLatRadCenterCartesian3D( vec2 center, float radius, float
|
|
|
102
102
|
tangent1 = normalize(tangent1);
|
|
103
103
|
// rotate tangent with given angle
|
|
104
104
|
tangent1 = cos(angle) * tangent1 - sin(angle) * cross(normal, tangent1);
|
|
105
|
-
|
|
105
|
+
float radius_in_angle = radius/R;
|
|
106
|
+
float projected_radius = sin(radius_in_angle) * R / 1000.0;
|
|
107
|
+
return (geoW * cos(radius_in_angle))+ tangent1 * projected_radius;
|
|
106
108
|
}
|
|
107
109
|
`;
|
|
108
110
|
|
|
109
111
|
// TODO: Make it precise. Y axis is not correct.
|
|
110
112
|
|
|
111
|
-
|
|
112
|
-
export const circleLimpFromLongLatRadCenterMercatorRealDistance = `
|
|
113
|
+
export const circleLimpFromLongLatRadCenterMercatorRealDistance = PI + `
|
|
113
114
|
vec2 circleLimpFromLongLatRadCenterMercatorRealDistance(vec2 center, float radius, float angle){
|
|
114
|
-
float
|
|
115
|
-
float
|
|
116
|
-
float
|
|
117
|
-
float
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return vec2(x, y);
|
|
115
|
+
float ang = angle + PI / 2.0; // this is there because rest of the program is in angle 0 is +x axis orientatation
|
|
116
|
+
float r = radius / R;
|
|
117
|
+
float sin_lat = sin( center.y) * cos(r) + cos(center.y)*sin(r)* cos(ang);
|
|
118
|
+
float lat = asin(sin_lat);
|
|
119
|
+
float longi = center.x + atan( sin(ang) * sin(r) * cos(center.y), cos(r) - sin(center.y) * sin_lat);
|
|
120
|
+
return longLatRadToMercator(vec2(longi, lat));
|
|
121
121
|
}
|
|
122
122
|
`;
|
|
123
123
|
|
|
@@ -206,7 +206,7 @@ export const angleBetweenTwoPointsRadian = `
|
|
|
206
206
|
float angleBetweenTwoPointsRadian(vec2 start_, vec2 end_) {
|
|
207
207
|
float start_lat = log( tan( ( 1.0 - start_.y ) * PI / 2.0 ) );
|
|
208
208
|
float end_lat = log( tan( ( 1.0 - end_.y ) * PI / 2.0 ) );
|
|
209
|
-
float angle = atan( (end_lat - start_lat )/ (end_.x - start_.x));
|
|
209
|
+
float angle = atan( (end_lat - start_lat ) / (end_.x - start_.x));
|
|
210
210
|
return angle;
|
|
211
211
|
}
|
|
212
212
|
`
|