three#Intersection TypeScript Examples

The following examples show how to use three#Intersection. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapHeightNode.ts    From geo-three with MIT License 6 votes vote down vote up
/**
	 * Overrides normal raycasting, to avoid raycasting when isMesh is set to false.
	 */
	public raycast(raycaster: Raycaster, intersects: Intersection[]): void
	{
		if (this.isMesh === true) 
		{
			return super.raycast(raycaster, intersects);
		}

		// @ts-ignore
		return false;
	}
Example #2
Source File: MapHeightNodeShader.ts    From geo-three with MIT License 6 votes vote down vote up
/**
	 * Overrides normal raycasting, to avoid raycasting when isMesh is set to false.
	 *
	 * Switches the geometry for a simpler one for faster raycasting.
	 */
	public raycast(raycaster: Raycaster, intersects: Intersection[]): void
	{
		if (this.isMesh === true) 
		{
			this.geometry = MapPlaneNode.geometry;

			const result = super.raycast(raycaster, intersects);

			this.geometry = MapHeightNodeShader.geometry;

			return result;
		}
		
		// @ts-ignore
		return false;
	}
Example #3
Source File: MapPlaneNode.ts    From geo-three with MIT License 6 votes vote down vote up
/**
	 * Overrides normal raycasting, to avoid raycasting when isMesh is set to false.
	 */
	public raycast(raycaster: Raycaster, intersects: Intersection[]): void
	{
		if (this.isMesh === true) 
		{
			return super.raycast(raycaster, intersects);
		}
		
		// @ts-ignore
		return false;
	}
Example #4
Source File: MapSphereNode.ts    From geo-three with MIT License 6 votes vote down vote up
/**
	 * Overrides normal raycasting, to avoid raycasting when isMesh is set to false.
	 */
	public raycast(raycaster: Raycaster, intersects: Intersection[]): void
	{
		if (this.isMesh === true) 
		{
			return super.raycast(raycaster, intersects);
		}
		
		// @ts-ignore
		return false;
	}
Example #5
Source File: MapHeightNode.d.ts    From geo-three with MIT License 5 votes vote down vote up
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
Example #6
Source File: MapHeightNodeShader.d.ts    From geo-three with MIT License 5 votes vote down vote up
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
Example #7
Source File: MapPlaneNode.d.ts    From geo-three with MIT License 5 votes vote down vote up
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
Example #8
Source File: MapSphereNode.d.ts    From geo-three with MIT License 5 votes vote down vote up
raycast(raycaster: Raycaster, intersects: Intersection[]): void;