Skip to main content

Class: Utils

Utils.Utils

A utility class providing helper methods for various operations.

Methods

computeBoundingSphereChildren

Static computeBoundingSphereChildren(target): void

Computes bounding spheres for child objects within the specified Object3D hierarchy.

Parameters

NameTypeDescription
targetObject3D<Object3DEventMap>The root Object3D from which to start computing bounding spheres for children.

Returns

void

Defined in

src/utils/Utils.ts:45


getNodes

Static getNodes(target): Nodes

Retrieves a map of objects in the scene graph (Object3D) starting from a root object. Each object is mapped using its unique name as the key in the resulting object.

Parameters

NameTypeDescription
targetObject3D<Object3DEventMap>The root object to begin generating the object map from.

Returns

Nodes

An object containing objects mapped by their names.

Defined in

src/utils/Utils.ts:60


getSceneIntersection

Static getSceneIntersection(ray, camera, distance): Vector3

Calculates the intersection point of a ray with a plane in world coordinates.

Parameters

NameTypeDescription
rayRayThe ray to intersect with the plane.
cameraCameraThe camera used as a reference for the plane's orientation.
distancenumberThe distance from the camera to the plane.

Returns

Vector3

The intersection point as Vector3.

Defined in

src/utils/Utils.ts:23


setChildrenDragTarget

Static setChildrenDragTarget(target, dragTarget): void

Set for all children of the target, the draggable flag to true and a dragTarget.

Parameters

NameTypeDescription
targetObject3D<Object3DEventMap>The Object3D whose children you want to enable as draggable elements. *
dragTargetObject3D<Object3DEventMap>The Object3D that will act as the drag target for the children.

Returns

void

Defined in

src/utils/Utils.ts:34