Members Show Inherited
| Name | Type | Default | Description |
|---|---|---|---|
className
|
String | Ray |
类名 |
isRay
|
Boolean | true |
是否是射线 |
origin
|
Vector3 |
原点 |
|
direction
|
Vector3 |
方向 |
Methods Show Inherited
-
set(origin, direction){Ray}
-
set
Name Type Description originVector3 directionVector3 Returns:
Type Description Ray this -
fromCamera(camera, x, y, width, height)
-
从摄像机设置
Name Type Description cameraCamera xNumber 屏幕x
yNumber 屏幕y
widthNumber 屏幕宽
heightNumber 屏幕高
-
transformMat4(mat4)
-
Transforms the ray with a mat4
Name Type Description mat4Matrix4 -
sortPoints(points, pointName)
-
排序碰撞点
Name Type Default Description pointsArray.<Vector3> | Array.<raycastInfo> pointNameString '' optional -
squaredDistance(point){Number}
-
squaredDistance
Name Type Description pointVector3 Returns:
Type Description Number -
distance(point){Number}
-
distance
Name Type Description pointVector3 Returns:
Type Description Number -
intersectsSphere(center, radius){Vector3}
-
intersectsSphere
Name Type Description centerArray.<Number> [x, y, z]
radiusNumber Returns:
Type Description Vector3 碰撞点,如果没有碰撞返回 null -
intersectsPlane(normal, distance){Vector3}
-
intersectsPlane
Name Type Description normalArray.<Number> [x, y, z]
distanceNumber Returns:
Type Description Vector3 碰撞点,如果没有碰撞返回 null -
intersectsTriangle(triangle){Vector3}
-
intersectsTriangle
Name Type Description triangleArray [[a.x, a.y, a.z], [b.x, b.y, b.z],[c.x, c.y, c.z]]
Returns:
Type Description Vector3 碰撞点,如果没有碰撞返回 null