Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Bump three and @types/three #5182

Merged
merged 8 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/studio-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@types/shallowequal": "1.1.1",
"@types/string-hash": "1.1.1",
"@types/text-metrics": "workspace:*",
"@types/three": "^0.140.0",
"@types/three": "^0.148.0",
"@types/tinycolor2": "1.4.3",
"@types/url-search-params": "1.1.0",
"@types/uuid": "9.0.0",
Expand Down Expand Up @@ -180,7 +180,7 @@
"string-replace-loader": "3.1.0",
"style-loader": "3.3.1",
"text-metrics": "3.0.0",
"three": "patch:three@0.140.2#../../patches/three.patch",
"three": "patch:three@0.148.0#../../patches/three.patch",
"tinycolor2": "1.4.2",
"ts-essentials": "9.3.0",
"ts-key-enum": "2.0.12",
Expand Down
4 changes: 2 additions & 2 deletions packages/studio-base/src/panels/ThreeDeeRender/ModelCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import { MeshoptDecoder } from "meshoptimizer";
import * as THREE from "three";
import dracoDecoderWasmUrl from "three/examples/jsm/../js/libs/draco/draco_decoder.wasm";
import dracoWasmWrapperJs from "three/examples/jsm/../js/libs/draco/draco_wasm_wrapper.js?raw";
import dracoDecoderWasmUrl from "three/examples/jsm/libs/draco/draco_decoder.wasm";
import dracoWasmWrapperJs from "three/examples/jsm/libs/draco/draco_wasm_wrapper.js?raw";
import { ColladaLoader } from "three/examples/jsm/loaders/ColladaLoader";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,7 @@ class LaserScanRenderable extends PointsHistoryRenderable<LaserScanUserData> {
for (let i = 0; i < ranges.length; i++) {
const colorValue = colorField === "range" ? ranges[i]! : intensities[i] ?? 0;
colorConverter(tempColor, colorValue);
colorAttribute.setXYZW(
i,
(tempColor.r * 255) | 0,
(tempColor.g * 255) | 0,
(tempColor.b * 255) | 0,
(tempColor.a * 255) | 0,
);
colorAttribute.setXYZW(i, tempColor.r, tempColor.g, tempColor.b, tempColor.a);
}

rangeAttribute.needsUpdate = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,10 @@ export class PointCloudRenderable extends PointsHistoryRenderable<PointCloudUser
const pointOffset = i * pointStep;
colorAttribute.setXYZW(
i,
(redReader(view, pointOffset) * 255) | 0,
(greenReader(view, pointOffset) * 255) | 0,
(blueReader(view, pointOffset) * 255) | 0,
(alphaReader(view, pointOffset) * 255) | 0,
redReader(view, pointOffset),
greenReader(view, pointOffset),
blueReader(view, pointOffset),
alphaReader(view, pointOffset),
);
}
} else {
Expand All @@ -509,13 +509,7 @@ export class PointCloudRenderable extends PointsHistoryRenderable<PointCloudUser
const pointOffset = i * pointStep;
const colorValue = packedColorReader(view, pointOffset);
colorConverter(tempColor, colorValue);
colorAttribute.setXYZW(
i,
(tempColor.r * 255) | 0,
(tempColor.g * 255) | 0,
(tempColor.b * 255) | 0,
(tempColor.a * 255) | 0,
);
colorAttribute.setXYZW(i, tempColor.r, tempColor.g, tempColor.b, tempColor.a);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ export class RenderableTriangles extends RenderablePrimitive {
`Entity: ${this.userData.entity?.id}.triangles[${triMeshIdx}](1st index) - Colors array should be same size as points array, showing #00ff00 instead`,
);
}
const r = (SRGBToLinear(color.r) * 255) | 0;
const g = (SRGBToLinear(color.g) * 255) | 0;
const b = (SRGBToLinear(color.b) * 255) | 0;
const a = (color.a * 255) | 0;
const r = SRGBToLinear(color.r);
const g = SRGBToLinear(color.g);
const b = SRGBToLinear(color.b);
const a = color.a;
colorChanged =
colorChanged ||
colors.getX(i) !== r ||
Expand Down Expand Up @@ -242,7 +242,7 @@ function makeTriangleMesh(): TriangleMesh {
metalness: 0,
roughness: 1,
flatShading: true,
side: THREE.DoubleSide,
side: THREE.TwoPassDoubleSide,
}),
);
}
Expand Down