fix: update distance text calculation to include cone height in MeasurementTool
This commit is contained in:
parent
73bb37e083
commit
c2d952c190
|
@ -10,7 +10,7 @@ function updateDistanceText(
|
||||||
|
|
||||||
////////// Updating the Distance Texts of the lines that are affected during drag //////////
|
////////// Updating the Distance Texts of the lines that are affected during drag //////////
|
||||||
|
|
||||||
const DistanceGroup = scene.children.find((child) => child.name === "Distance_Text") as THREE.Group;
|
const DistanceGroup = scene.getObjectByName('Distance_Text') as THREE.Group;
|
||||||
|
|
||||||
affectedLines.forEach((lineIndex) => {
|
affectedLines.forEach((lineIndex) => {
|
||||||
const mesh = floorPlanGroupLine.current.children[lineIndex] as THREE.Mesh;
|
const mesh = floorPlanGroupLine.current.children[lineIndex] as THREE.Mesh;
|
||||||
|
|
|
@ -10,7 +10,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
||||||
const [selectedComment, setSelectedComment] = useState<CommentSchema | null>(null);
|
const [selectedComment, setSelectedComment] = useState<CommentSchema | null>(null);
|
||||||
const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null);
|
const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
const keyCombination = detectModifierKeys(e);
|
const keyCombination = detectModifierKeys(e);
|
||||||
|
@ -43,20 +42,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
||||||
className='comments-main-wrapper'
|
className='comments-main-wrapper'
|
||||||
>
|
>
|
||||||
<CommentThreads />
|
<CommentThreads />
|
||||||
{/* <div
|
|
||||||
className='outer'
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
setSelectedComment(comment);
|
|
||||||
console.log("down");
|
|
||||||
}}
|
|
||||||
onPointerOver={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
}}>
|
|
||||||
<div>
|
|
||||||
hii
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
</Html>
|
</Html>
|
||||||
{CommentRef.current && transformMode && (
|
{CommentRef.current && transformMode && (
|
||||||
<TransformControls
|
<TransformControls
|
||||||
|
|
|
@ -218,7 +218,7 @@ const MeasurementTool = () => {
|
||||||
sprite
|
sprite
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
{startConePosition.distanceTo(endConePosition).toFixed(2)} m
|
{(startConePosition.distanceTo(endConePosition) + (coneSize.height)).toFixed(2)} m
|
||||||
</div>
|
</div>
|
||||||
</Html>
|
</Html>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue