conststate=useThree<Types.ThreeState>();// Importing the state from the useThree hook, which contains the scene, camera, and other Three.js elements.
constcsg=useRef();// Reference for CSG object, used for 3D modeling.
constCSGGroup=useRef()asTypes.RefMesh;// Reference to a group of CSG objects.
constscene=useRef()asTypes.RefScene;// Reference to the scene.
constcamera=useRef()asTypes.RefCamera;// Reference to the camera object.
constcontrols=useRef<any>();// Reference to the controls object.
constraycaster=useRef()asTypes.RefRaycaster;// Reference for raycaster used for detecting objects being pointed at in the scene.
constdragPointControls=useRef()asTypes.RefDragControl;// Reference for drag point controls, an array for drag control.
// Assigning the scene and camera from the Three.js state to the references.
scene.current=state.scene;
camera.current=state.camera;
controls.current=state.controls;
raycaster.current=state.raycaster;
constplane=useRef<THREE.Mesh>(null);// Reference for a plane object for raycaster reference.
constgrid=useRef()asany;// Reference for a grid object for raycaster reference.
constsnappedPoint=useRef()asTypes.RefVector3;// Reference for storing a snapped point at the (end = isSnapped) and (start = ispreSnapped) of the line.
constisSnapped=useRef(false)asTypes.RefBoolean;// Boolean reference to indicate if an object is snapped at the (end).
constanglesnappedPoint=useRef()asTypes.RefVector3;// Reference for storing an angle-snapped point when the line is in 90 degree etc...
constisAngleSnapped=useRef(false)asTypes.RefBoolean;// Boolean to indicate if angle snapping is active.
constisSnappedUUID=useRef()asTypes.RefString;// UUID reference to identify the snapped point.
constispreSnapped=useRef(false)asTypes.RefBoolean;// Boolean reference to indicate if an object is snapped at the (start).
consttempLoader=useRef()asTypes.RefMesh;// Reference for a temporary loader for the floor items.
constisTempLoader=useRef()asTypes.RefBoolean;// Reference to check if a temporary loader is active.
constTube=useRef()asTypes.RefTubeGeometry;// Reference for tubes used for reference line creation and updation.
constline=useRef([])asTypes.RefLine;// Reference for line which stores the current line that is being drawn.
constlines=useRef([])asTypes.RefLines;// Reference for lines which stores all the lines that are ever drawn.
constonlyFloorline=useRef<Types.OnlyFloorLine>([]);// Reference for floor lines which does not have walls or roof and have only floor used to store the current line that is being drawn.
constonlyFloorlines=useRef<Types.OnlyFloorLines>([]);// Reference for all the floor lines that are ever drawn.
constReferenceLineMesh=useRef()asTypes.RefMesh;// Reference for storing the mesh of the reference line for moving it during draw.
constLineCreated=useRef(false)asTypes.RefBoolean;// Boolean to track whether the reference line is created or not.
constreferencePole=useRef()asTypes.RefMesh;// Reference for a pole that is used as the reference for the user to show where it is placed.
constitemsGroup=useRef()asTypes.RefGroup;// Reference to the THREE.Group that has the floor items (Gltf).
constfloorGroup=useRef()asTypes.RefGroup;// Reference to the THREE.Group that has the roofs and the floors.
constAttachedObject=useRef()asTypes.RefMesh;// Reference for an object that is attached using dbl click for transform controls rotation.
constfloorPlanGroup=useRef()asTypes.RefGroup;// Reference for a THREE.Group that has the lines group and the points group.
constfloorPlanGroupLine=useRef()asTypes.RefGroup;// Reference for a THREE.Group that has the lines that are drawn.
constfloorPlanGroupPoint=useRef()asTypes.RefGroup;// Reference for a THREE.Group that has the points that are created.
constfloorGroupAisle=useRef()asTypes.RefGroup;
constzoneGroup=useRef()asTypes.RefGroup;
constcurrentLayerPoint=useRef([])asTypes.RefMeshArray;// Reference for points that re in the current layer used to update the points in drag controls.
consthoveredDeletablePoint=useRef()asTypes.RefMesh;// Reference for the currently hovered point that can be deleted.
consthoveredDeletableLine=useRef()asTypes.RefMesh;// Reference for the currently hovered line that can be deleted.
consthoveredDeletableFloorItem=useRef()asTypes.RefMesh;// Reference for the currently hovered floor item that can be deleted.
consthoveredDeletableWallItem=useRef()asTypes.RefMesh;// Reference for the currently hovered wall item that can be deleted.
consthoveredDeletablePillar=useRef()asTypes.RefMesh;// Reference for the currently hovered pillar that can be deleted.
constcurrentWallItem=useRef()asTypes.RefMesh;// Reference for the currently selected wall item that can be scaled, dragged etc...
constcursorPosition=newTHREE.Vector3();// 3D vector for storing the cursor position.