@three3d/tools
Version:
@three3d/tools 提供了 ThreeJS 常用的工具库
27 lines (15 loc) • 949 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [/tools](./tools.md) > [computeIntersectionOfRay\_LineSegment](./tools.computeintersectionofray_linesegment.md)
## computeIntersectionOfRay\_LineSegment() function
计算射线和线段的交点
**Signature:**
```typescript
export declare function computeIntersectionOfRay_LineSegment<Vec extends VectorInstance>(ray: [Vec, Vec], lineSegment: [Vec, Vec]): import("three").Vector3 | import("three").Vector2 | import("three").Vector4 | null;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ray | \[Vec, Vec\] | 射线,第一个点射线的起点,第二个点为射线所经过的任意一点(注意,不是射线的方向) |
| lineSegment | \[Vec, Vec\] | |
**Returns:**
import("three").Vector3 \| import("three").Vector2 \| import("three").Vector4 \| null