This commit is contained in:
trung09122002
2026-09-21 09:22:57 +07:00
parent 3090cf4124
commit 0e4ad198ff

View File

@@ -810,6 +810,33 @@ function v3dSetBodyVisible(on) {
function v3dSetFramesVisible(on) {
if (V3D.framesMesh) V3D.framesMesh.visible = !!on;
// Khi hien TF thi lam THAN robot trong suot.
//
// Than la khoi hop 0.85 m; LiDAR o 0.13 m va camera o 0.31 m deu NAM TRONG
// no, nen o che do dac thi khong thay bo truc nao ca. Bat/tat han thi lai
// mat ngu canh -- khong biet cam bien nam dau so voi than.
//
// depthWrite = false la phan bat buoc: thieu no thi mat trong suot van ghi
// vao depth buffer va van che nhung gi ve SAU no, tuc bo truc bien mat du
// da nhin xuyen duoc qua than.
if (!V3D.bodyMesh) return;
V3D.bodyMesh.traverse((o) => {
if (!o.material) return;
if (!o.userData.matSolid) o.userData.matSolid = o.material;
if (on) {
if (!o.userData.matGhost) {
const m = o.material.clone();
m.transparent = true;
m.opacity = 0.18;
m.depthWrite = false;
o.userData.matGhost = m;
}
o.material = o.userData.matGhost;
} else {
o.material = o.userData.matSolid;
}
});
}
function v3dSetOverlays(on) {