Skip to content

Commit 79357e3

Browse files
committed
Support Rope.alpha
1 parent 2f6921b commit 79357e3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/gameobjects/rope/RopeWebGLRenderer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera
6363
var uvs = src.uv;
6464
var colors = src.colors;
6565
var alphas = src.alphas;
66+
var alpha = src.alpha;
67+
var getTint = Utils.getTintAppendFloatAlphaAndSwap;
68+
var roundPixels = camera.roundPixels;
6669

6770
var meshVerticesLength = vertices.length;
6871
var vertexCount = Math.floor(meshVerticesLength * 0.5);
@@ -94,7 +97,7 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera
9497
var tx = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e;
9598
var ty = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f;
9699

97-
if (camera.roundPixels)
100+
if (roundPixels)
98101
{
99102
tx = Math.round(tx);
100103
ty = Math.round(ty);
@@ -105,7 +108,7 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera
105108
vertexViewF32[++vertexOffset] = uvs[i + 0];
106109
vertexViewF32[++vertexOffset] = uvs[i + 1];
107110
vertexViewF32[++vertexOffset] = tintEffect;
108-
vertexViewU32[++vertexOffset] = Utils.getTintAppendFloatAlphaAndSwap(colors[colorIndex], camera.alpha * alphas[colorIndex]);
111+
vertexViewU32[++vertexOffset] = getTint(colors[colorIndex], camera.alpha * (alphas[colorIndex] * alpha));
109112

110113
colorIndex++;
111114
}

0 commit comments

Comments
 (0)