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 //////////
|
||||
|
||||
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) => {
|
||||
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 [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
const keyCombination = detectModifierKeys(e);
|
||||
|
@ -43,20 +42,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
|||
className='comments-main-wrapper'
|
||||
>
|
||||
<CommentThreads />
|
||||
{/* <div
|
||||
className='outer'
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setSelectedComment(comment);
|
||||
console.log("down");
|
||||
}}
|
||||
onPointerOver={(e) => {
|
||||
e.stopPropagation();
|
||||
}}>
|
||||
<div>
|
||||
hii
|
||||
</div>
|
||||
</div> */}
|
||||
</Html>
|
||||
{CommentRef.current && transformMode && (
|
||||
<TransformControls
|
||||
|
|
|
@ -218,7 +218,7 @@ const MeasurementTool = () => {
|
|||
sprite
|
||||
>
|
||||
<div>
|
||||
{startConePosition.distanceTo(endConePosition).toFixed(2)} m
|
||||
{(startConePosition.distanceTo(endConePosition) + (coneSize.height)).toFixed(2)} m
|
||||
</div>
|
||||
</Html>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue