decal bug fix
This commit is contained in:
@@ -36,6 +36,7 @@ function DecalCreator() {
|
|||||||
const intersects = raycaster.intersectObjects(scene.children, true);
|
const intersects = raycaster.intersectObjects(scene.children, true);
|
||||||
const wallIntersect = intersects.find(i => i.object.userData && i.object.userData.wallUuid);
|
const wallIntersect = intersects.find(i => i.object.userData && i.object.userData.wallUuid);
|
||||||
const floorIntersect = intersects.find(i => i.object.userData && i.object.userData.floorUuid);
|
const floorIntersect = intersects.find(i => i.object.userData && i.object.userData.floorUuid);
|
||||||
|
console.log('wallIntersect: ', wallIntersect);
|
||||||
|
|
||||||
if (wallIntersect) {
|
if (wallIntersect) {
|
||||||
const wall = getWallById(wallIntersect.object.userData.wallUuid);
|
const wall = getWallById(wallIntersect.object.userData.wallUuid);
|
||||||
@@ -51,7 +52,7 @@ function DecalCreator() {
|
|||||||
type: 'Wall',
|
type: 'Wall',
|
||||||
wallUuid: wallIntersect.object.userData.wallUuid,
|
wallUuid: wallIntersect.object.userData.wallUuid,
|
||||||
},
|
},
|
||||||
decalPosition: [point.x, point.y, wall.wallThickness / 2 + 0.001],
|
decalPosition: [point.x, point.y, (wall.wallThickness / 2 + 0.001) * (wallIntersect.normal?.z || 1)],
|
||||||
decalRotation: 0,
|
decalRotation: 0,
|
||||||
decalOpacity: 1,
|
decalOpacity: 1,
|
||||||
decalScale: 1,
|
decalScale: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user