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 origin
Vector3 direction
Vector3 Returns:
Type Description Ray this -
fromCamera(camera, x, y, width, height)
-
从摄像机设置
Name Type Description camera
Camera x
Number 屏幕x
y
Number 屏幕y
width
Number 屏幕宽
height
Number 屏幕高
-
transformMat4(mat4)
-
Transforms the ray with a mat4
Name Type Description mat4
Matrix4 -
sortPoints(points, pointName)
-
排序碰撞点
Name Type Default Description points
Array.<Vector3> | Array.<raycastInfo> pointName
String '' optional -
squaredDistance(point){Number}
-
squaredDistance
Name Type Description point
Vector3 Returns:
Type Description Number -
distance(point){Number}
-
distance
Name Type Description point
Vector3 Returns:
Type Description Number -
intersectsSphere(center, radius){Vector3}
-
intersectsSphere
Name Type Description center
Array.<Number> [x, y, z]
radius
Number Returns:
Type Description Vector3 碰撞点,如果没有碰撞返回 null -
intersectsPlane(normal, distance){Vector3}
-
intersectsPlane
Name Type Description normal
Array.<Number> [x, y, z]
distance
Number Returns:
Type Description Vector3 碰撞点,如果没有碰撞返回 null -
intersectsTriangle(triangle){Vector3}
-
intersectsTriangle
Name Type Description triangle
Array [[a.x, a.y, a.z], [b.x, b.y, b.z],[c.x, c.y, c.z]]
Returns:
Type Description Vector3 碰撞点,如果没有碰撞返回 null