M3D / M3D / Actions / RaypickAction
Class: RaypickAction
Memberof
M3D.Actions
Description
射线拾取Action
Author
YW
Date
Hierarchy
-
↳
RaypickAction
Table of contents
Constructors
Properties
Methods
- addIntersectPnt
- addIntersectTrianglePnts
- addShape
- addToFramePickCollection
- beginOnceFramePick
- beginPickAsGroup
- canPickGeo
- canPickShape
- endPickAsGroup
- execute
- frustumIntersectWithWorldBox
- getAllPickPoint
- getData
- getEvents
- getFarPickShape
- getFramePickMatchPntCount
- getFramePickShapes
- getFramePickType
- getId
- getIntersectPnts
- getIntersectType
- getIsPickAll
- getNearPickPoint
- getNearPickShape
- getNearestPickPoint
- getNormal
- getOnceFramePickCount
- getPickGeoType
- getPickShapeType
- getScreenPoint
- getUseClipPlane
- getViewport
- increaseFramePickMatchPntCount
- increaseFramePickPntCount
- intersect
- isIntersectRayAndTriangle
- isPointInFrustum
- isintersecFrustumLine
- isintersecFrustumTriangle
- registerEvent
- removeEvent
- setFramePickSection
- setFramePickType
- setId
- setIntersectType
- setNearestPickPoint
- setPickAll
- setPickGeoType
- setPickRadius
- setPickShapeFilterType
- setPickShapeType
- setRay
- setShapePickState
- setUseClipPlane
- setViewport
- updateFramePickFrustum
- updateGroupPickPnts
- updateIntersectPnts
- updateModelRay
- getPickPosition
- getPickShape
Constructors
constructor
• new RaypickAction(viewport
): RaypickAction
Parameters
Name | Type | Description |
---|---|---|
viewport | Viewport | 视口 |
Returns
Description
构造函数
Overrides
Properties
id
• id: number
Inherited from
count
▪ Static
count: number
Inherited from
Methods
addIntersectPnt
▸ addIntersectPnt(pos
): void
Parameters
Name | Type | Description |
---|---|---|
pos | Vector3 | 模型交点 |
Returns
void
Description
临时记录和模型的相交点
addIntersectTrianglePnts
▸ addIntersectTrianglePnts(normal
): void
Parameters
Name | Type |
---|---|
normal | Vector3 |
Returns
void
Description
给存储射线和三角面片的交点添加射线相交的三角面片法线
addShape
▸ addShape(shape
, zIndex?
): void
Parameters
Name | Type | Description |
---|---|---|
shape | Shape | shape对象 |
zIndex? | number | 拾取优先级 |
Returns
void
Description
将相交对象,加入缓存列表,供最后判断拾取先后关系使用
addToFramePickCollection
▸ addToFramePickCollection(shape
): void
Parameters
Name | Type | Description |
---|---|---|
shape | Shape | Shape对象 |
Returns
void
Description
添加到框选集合
beginOnceFramePick
▸ beginOnceFramePick(): void
Returns
void
Description
开始当前一次框选
beginPickAsGroup
▸ beginPickAsGroup(shape
): void
Parameters
Name | Type |
---|---|
shape | Shape |
Returns
void
Description
以组开始拾取(未实现)
canPickGeo
▸ canPickGeo(geoType
): boolean
Parameters
Name | Type | Description |
---|---|---|
geoType | GeoFeatureEnum | 待判断的几何属性类型 |
Returns
boolean
true 能够拾取此类型 false 不能够拾取此类型
Description
判断当前拾取动作,能否拾取此几何类型的shape
canPickShape
▸ canPickShape(shapeType
): boolean
Parameters
Name | Type | Description |
---|---|---|
shapeType | ShapeType | 待判断的类型 |
Returns
boolean
true 能够拾取此类型 false 不能够拾取此类型
Description
判断当前拾取动作能否拾取此类型
endPickAsGroup
▸ endPickAsGroup(shape
, zIndex?
): void
Parameters
Name | Type |
---|---|
shape | Shape |
zIndex? | number |
Returns
void
Description
结束以组拾取(未实现)
execute
▸ execute(): ActionState
Returns
Description
执行Action
Inherited from
frustumIntersectWithWorldBox
▸ frustumIntersectWithWorldBox(box
): boolean
Parameters
Name | Type | Description |
---|---|---|
box | BoundingBox | 待求交的包围盒 |
Returns
boolean
true相交 false 不相交
Description
是否和包围盒相交
getAllPickPoint
▸ getAllPickPoint(shape
): Vector3
[]
Parameters
Name | Type |
---|---|
shape | Shape |
Returns
Vector3
[]
所有拾取点
Description
获取所有拾取点
getData
▸ getData(): RayPickActionData
Returns
射线求交数据
Description
获取射线求交的数据
getEvents
▸ getEvents(): M3DEvent
[]
Returns
M3DEvent
[]
Description
获得事件列表
Inherited from
getFarPickShape
▸ getFarPickShape(): Shape
Returns
拾取到的对象 null 表示没有拾取到
Description
得到最后端拾取对象
getFramePickMatchPntCount
▸ getFramePickMatchPntCount(): number
Returns
number
框选相交模型数量
Description
获取当前一次框选相交模型数量
getFramePickShapes
▸ getFramePickShapes(): Shape
[]
Returns
Shape
[]
拾取到的对象 null 表示没有拾取到
Description
获取存储所有框选相交的对象
getFramePickType
▸ getFramePickType(): number
Returns
number
框选类型 1 inside 全部在内部 2 intersect 相交即可
Description
获取框选类型
getId
▸ getId(): number
Returns
number
Description
获取id
Inherited from
getIntersectPnts
▸ getIntersectPnts(): Vector3
[]
Returns
Vector3
[]
模型交点数组
Description
获取所有和模型的相交点
getIntersectType
▸ getIntersectType(): number
Returns
number
求交类型 0 三角网格相交 1 线相交 2 点相交
Description
获取求交类型 0 三角网格相交 1 线相交 2 点相交
getIsPickAll
▸ getIsPickAll(): boolean
Returns
boolean
是否框选
Description
是否框选
getNearPickPoint
▸ getNearPickPoint(): Vector3
Returns
拾取到的点 null表示没有拾取到
Description
得到最前端的拾取到的点
getNearPickShape
▸ getNearPickShape(): Shape
Returns
拾取到的对象 null 表示没有拾取到
Description
得到最前端拾取对象
getNearestPickPoint
▸ getNearestPickPoint(): Vector3
Returns
拾取到的模型最近的点
Description
获取拾取到的模型最近的点
getNormal
▸ getNormal(): Vector3
Returns
返回法向
Description
返回拾取到的三角面片的法向
getOnceFramePickCount
▸ getOnceFramePickCount(): number
Returns
number
框选数量
Description
获取当前框选数量
getPickGeoType
▸ getPickGeoType(): GeoFeatureEnum
Returns
允许拾取对象的几何属性类型
Description
获取允许拾取对象的几何属性类型
getPickShapeType
▸ getPickShapeType(): PickShapeFilterType
Returns
拾取类型
Description
获取拾取类型
getScreenPoint
▸ getScreenPoint(): Vector2
Returns
屏幕点
Description
获取屏幕点
getUseClipPlane
▸ getUseClipPlane(): boolean
Returns
boolean
是否需要考虑裁剪平面
Description
获取是否需要考虑裁剪平面
getViewport
▸ getViewport(): Viewport
Returns
视口对象
Description
获取当前视口
increaseFramePickMatchPntCount
▸ increaseFramePickMatchPntCount(): void
Returns
void
Description
当前一次框选相交模型数量加一
increaseFramePickPntCount
▸ increaseFramePickPntCount(): void
Returns
void
Description
当前框选拾取数量加一
intersect
▸ intersect(v0
, v1
): Vector3
Parameters
Name | Type | Description |
---|---|---|
v0 | Vector3 | 线段起点 |
v1 | Vector3 | 线段终点 |
Returns
交点 null表示没有交点
Description
射线是否和线段相交
▸ intersect(point
): boolean
Parameters
Name | Type | Description |
---|---|---|
point | Vector3 | 待判断点 |
Returns
boolean
true相交 false不相交
Description
射线是否和 点相交
▸ intersect(point
, size
): boolean
Parameters
Name | Type | Description |
---|---|---|
point | Vector3 | 待判断点 |
size | number | 点的大小 |
Returns
boolean
true相交 false不相交
Description
射线折否和点相交
isIntersectRayAndTriangle
▸ isIntersectRayAndTriangle(v0
, v1
, v2
): Vector3
Parameters
Name | Type | Description |
---|---|---|
v0 | Vector3 | 三角形第一个点 |
v1 | Vector3 | 第二个点 |
v2 | Vector3 | 第三个点 |
Returns
交点 null表示没有交点
Description
射线是否和三角形有交点
▸ isIntersectRayAndTriangle(v0
, v1
, v2
, ray
): Vector3
Parameters
Name | Type | Description |
---|---|---|
v0 | Vector3 | 三角形第一个点 |
v1 | Vector3 | 第二个点 |
v2 | Vector3 | 第三个点 |
ray | Ray | 射线 |
Returns
交点 null表示没有交点
Description
射线是否和三角形有交点
isPointInFrustum
▸ isPointInFrustum(v0
): boolean
Parameters
Name | Type |
---|---|
v0 | Vector3 |