Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / types / RaycastOptions

Type Alias: RaycastOptions ​

ts
type RaycastOptions = {
  near?: number;
  far?: number;
  firstHitOnly?: boolean;
  visibleOnly?: boolean;
  entities?: readonly EntityId[];
  objects?: readonly THREE.Object3D[];
  ignore?: readonly EntityId[];
  layers?: RaycastLayers | number;
};

Defined in: types.ts:173

Properties ​

PropertyTypeDescriptionDefined in
near?numberMinimum hit distance (when passing options in place of near).types.ts:175
far?numberMaximum hit distance.types.ts:177
firstHitOnly?booleanOnly the nearest hit. Meshes are tried nearest first and the search stops once nothing left can be nearer: much cheaper in a big scene.types.ts:182
visibleOnly?booleanSkip hidden objects and everything under them.types.ts:184
entities?readonly EntityId[]Test only these entities (and their children).types.ts:186
objects?readonly THREE.Object3D[]Test only these objects (and their children).types.ts:188
ignore?readonly EntityId[]Never hit these entities or anything under them.types.ts:190
layers?RaycastLayers | numberOnly objects on these three.js layers (a Layers, or one layer number).types.ts:192