decal bug fix
This commit is contained in:
@@ -15,7 +15,7 @@ import { getUserData } from '../../../../functions/getUserData';
|
||||
function DecalCreator() {
|
||||
const { wallStore, floorStore } = useSceneContext();
|
||||
const { addDecal: addDecalOnWall, getWallById } = wallStore();
|
||||
const { addDecal : addDecalOnFloor, getFloorById } = floorStore();
|
||||
const { addDecal: addDecalOnFloor, getFloorById } = floorStore();
|
||||
const { droppedDecal } = useDroppedDecal();
|
||||
const { activeModule } = useModuleStore();
|
||||
const { userId, organization } = getUserData();
|
||||
@@ -36,6 +36,7 @@ function DecalCreator() {
|
||||
const intersects = raycaster.intersectObjects(scene.children, true);
|
||||
const wallIntersect = intersects.find(i => i.object.userData && i.object.userData.wallUuid);
|
||||
const floorIntersect = intersects.find(i => i.object.userData && i.object.userData.floorUuid);
|
||||
console.log('wallIntersect: ', wallIntersect);
|
||||
|
||||
if (wallIntersect) {
|
||||
const wall = getWallById(wallIntersect.object.userData.wallUuid);
|
||||
@@ -51,7 +52,7 @@ function DecalCreator() {
|
||||
type: 'Wall',
|
||||
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,
|
||||
decalOpacity: 1,
|
||||
decalScale: 1,
|
||||
|
||||
Reference in New Issue
Block a user