-
<protected> _addTo(engine)
-
添加到地图并触发加载
Parameters:
| Name |
Type |
Description |
engine |
Engine
|
引擎 |
-
<protected> _updateOffset()
-
根据 offsetRotation 与指定旋转点,反算 offset
-
<protected> _updateOffsetRotation()
-
根据 offset 与指定旋转点,同步 offsetRotation
-
addAllAnimations(playOpt)
-
播放模型内全部骨骼动画
Parameters:
| Name |
Type |
Description |
playOpt |
Object
|
播放选项
Properties
| Name |
Type |
Argument |
Default |
Description |
playMode |
Number
|
<optional>
|
|
循环模式,默认 REPEAT |
multiplier |
Number
|
<optional>
|
1
|
播放倍速 |
delay |
Number
|
<optional>
|
0
|
延迟(秒) |
reverse |
Boolean
|
<optional>
|
false
|
是否反向播放 |
|
Returns:
-
Type
-
ModelAnimation
|
undefined
-
addAnimation(animationOpt)
-
按名称或索引播放单个骨骼动画
Parameters:
| Name |
Type |
Description |
animationOpt |
Object
|
动画选项
Properties
| Name |
Type |
Argument |
Description |
name |
String
|
<optional>
|
动画名称 |
index |
Number
|
<optional>
|
动画索引 |
playMode |
Number
|
<optional>
|
循环模式,默认 REPEAT |
|
Returns:
-
Type
-
ModelAnimation
|
undefined
-
addDragHandle()
-
在场景中添加拖拽操作句柄
- Overrides:
-
Glodon.CIMCube.Layer.BaseLayer#addDragHandle
Returns:
拖拽句柄实例
-
Type
-
Object
-
addMultiClippingPlane(id, collections, region)
-
按 id 添加一组多裁剪平面
Parameters:
| Name |
Type |
Description |
id |
String
|
裁剪组标识 |
collections |
Array.<ClippingPlaneCollection>
|
裁剪平面集合数组 |
region |
MultiClippingPlaneRegion
|
裁剪区域配置(边线颜色、宽度、模式等) |
-
addTo(map)
-
将图层添加到图层管理器中
Parameters:
- Inherited From:
-
- Overrides:
-
-
批量触发 sceneGraph 更新(等价 GSMMLayer.updateModelMatrix):
将所有 setNodeTransform 的覆盖态重新写回运行时节点,
子树刷新按父子链去重后只刷最上层一次,最后刷新包围盒并标记动画/蒙皮矩阵重算。
Returns:
实际写回(含重写)的节点数
-
Type
-
number
-
dispatchEvent(event)
-
在此事件派发器上派发事件.
Parameters:
| Name |
Type |
Description |
event |
Object
|
待派发的事件. |
- Inherited From:
-
- Overrides:
-
dispose()
-
释放图层及其内部模型资源
-
enuToWorldPosition(enuPosition)
-
将以图层原点为基准的东北天 ENU 偏移 (x=东, y=北, z=天) 转换为世界坐标
Parameters:
| Name |
Type |
Description |
enuPosition |
Cartesian3
|
ENU 偏移坐标 |
Returns:
世界坐标
-
Type
-
Cartesian3
|
undefined
-
flyTo()
-
摄像机定位到图层;模型未就绪时会等待 ready 后再飞行
Returns:
是否成功发起飞行
-
Type
-
Promise.<Boolean>
-
getAllAnimation()
-
获取当前正在运行的全部动画
Returns:
-
Type
-
Array.<ModelAnimation>
|
undefined
-
getAllUsdCustomAttributesByPath()
-
读取所有 Prim 路径及其 custom attributes
Returns:
Prim 路径 → custom attributes
-
Type
-
Record.<String, Object>
-
getAllUsdNodePaths()
-
枚举全部可控制的 USD Prim 节点路径
Returns:
-
Type
-
Array.<string>
-
getAnimationByIndex(index)
-
按索引查找骨骼动画
Parameters:
| Name |
Type |
Description |
index |
Number
|
动画索引 |
Returns:
-
Type
-
ModelAnimation
|
undefined
-
getAnimationByName(animationName)
-
按名称查找骨骼动画
Parameters:
| Name |
Type |
Description |
animationName |
String
|
动画名称 |
Returns:
-
Type
-
ModelAnimation
|
undefined
-
getBoundingSphere()
-
获取模型包围球;优先使用加载阶段算出的视觉包围球
Returns:
-
Type
-
BoundingSphere
|
undefined
-
getBoundingVolume()
-
获取模型有向包围盒(基于 sceneGraph 顶点 AABB 计算,结果会缓存)
Returns:
-
Type
-
OrientedBoundingBox
|
undefined
-
getBoundingVolumeHeight()
-
获取有向包围盒高度(米)
Returns:
-
Type
-
Number
|
undefined
-
getClipTarget()
-
获取模型剖切目标对象
Returns:
-
Type
-
Model
|
undefined
-
getJointPaths( [skeletonPath])
-
查询关节路径
Parameters:
| Name |
Type |
Argument |
Description |
skeletonPath |
string
|
<optional>
|
骨骼路径;缺省返回全部关节路径的并集 |
Returns:
关节路径列表
-
Type
-
Array.<string>
-
getModel()
-
获取内部 Cesium Model,用于动画、剖切、拾取等操作
Returns:
-
Type
-
Model
|
undefined
-
getNodeByUsdPath(usdPath)
-
按 USD Prim 路径访问节点(对应 GSMMLayer.getChildByID)。
返回可操作包装对象;若路径对应的 glTF 节点尚未形成运行时节点,runtimeNode 为 undefined。
Parameters:
| Name |
Type |
Description |
usdPath |
string
|
USD Prim 路径,如 "/World/Robot/Arm" |
Returns:
USDNodeHandle
-
Type
-
Object
|
undefined
-
-
读取节点当前生效的局部 TRS(含矩阵)。
Parameters:
| Name |
Type |
Description |
usdPath |
string
|
USD Prim 路径 |
Returns:
USDNodeTransform
-
Type
-
Object
|
undefined
-
getOriginWorldCoord()
-
获取图层原点世界坐标(含当前变换)
Returns:
-
Type
-
Cartesian3
|
undefined
-
getParentId()
-
获取父节点ID
- Inherited From:
-
- Overrides:
Returns:
父节点ID
-
Type
-
String
-
getPhysicsJointData(usdPath)
-
读取单个 UsdPhysics 物理约束关节的描述对象。
Parameters:
| Name |
Type |
Description |
usdPath |
string
|
关节 USD Prim 路径 |
Returns:
关节描述对象:
{ kind: "joint", schemaName, jointType, body0, body1, axis, lowerLimit, upperLimit,
localPos0, localPos1, localRot0, localRot1, drives, apiSchemas }
body0/body1 为绑定刚体 Prim 路径;localPos/localRot 按 metersPerUnit 已换算为米;
drives 形如 { linear?: {...}, angular?: {...} }。
-
Type
-
Object
|
undefined
-
getPhysicsJointPaths()
-
查询全部 UsdPhysics 物理约束关节的 USD Prim 路径。
识别依据:Prim 上应用了 UsdPhysicsJoint / UsdPhysicsRevoluteJoint 等关节 schema
(USD 资产以 Xform + apiSchemas 或类型化 Prim 书写)。
Returns:
关节路径列表(无物理关节时为空数组)
-
Type
-
Array.<string>
-
getPhysicsRigidBodyPaths()
-
查询全部 UsdPhysicsRigidBodyAPI 刚体 Prim 路径。
一个路径对应一个物理刚体;其子 Collision/Mesh 是该刚体的碰撞形状,不是独立刚体。
Returns:
-
Type
-
Array.<string>
-
getUsdCableDataByPath()
-
查询 USD 钢缆元数据(BoomCable / BasisCurves)。不进物理,仅供 RopeLines。
Returns:
-
Type
-
Record.<string, Object>
|
null
-
getUsdCustomAttributesByPath(usdPath)
-
读取指定 USD Prim 路径上的 custom attributes
Parameters:
| Name |
Type |
Description |
usdPath |
String
|
Prim 路径,例:"/World/Building" |
Returns:
custom attributes 键值对象
-
Type
-
Object
|
undefined
-
getUsdPhysicsDataByPath()
-
查询当前模型加载到的全部 UsdPhysics 关节数据映射(只读引用)。
Returns:
-
Type
-
Record.<string, Object>
|
null
-
invalidateBoundingVolume()
-
清除 OBB 缓存,下次 getBoundingVolume / getBoundingVolumeHeight 将重新计算
-
localToWorldPosition(localPosition)
-
将模型局部坐标转换为世界坐标
Parameters:
| Name |
Type |
Description |
localPosition |
Cartesian3
|
模型局部坐标 |
Returns:
世界坐标
-
Type
-
Cartesian3
|
undefined
-
move(angle, distance [, mode])
-
指定角度移动图层,顺时针旋转
Parameters:
| Name |
Type |
Argument |
Default |
Description |
angle |
Number
|
|
|
指定角度(度);y-x 平面 0° 为正北,z-x / z-y 平面 0° 为垂直地表向外 |
distance |
Number
|
|
|
移动距离(米) |
mode |
String
|
<optional>
|
"y-x"
|
移动平面,枚举:y-x、z-x、z-y |
Returns:
更新后的 offset
-
Type
-
Array.<Number>
-
removeAllAnimation()
-
移除模型内全部骨骼动画
-
removeAnimation(targetAnimation)
-
移除指定骨骼动画
Parameters:
| Name |
Type |
Description |
targetAnimation |
ModelAnimation
|
目标动画实例 |
-
removeDragHandle()
-
在场景中移除操作句柄
- Inherited From:
-
- Overrides:
-
<protected> removeFrom(callByManager)
-
从地图中移除
Parameters:
| Name |
Type |
Description |
callByManager |
Boolean
|
是否由管理器调用 |
- Overrides:
-
removeMultiClippingPlane(id)
-
按 id 移除一组多裁剪平面
Parameters:
| Name |
Type |
Description |
id |
String
|
裁剪组标识 |
-
-
恢复某节点到原始局部变换(清除覆盖态;userAnimated 复位后预烘焙动画可重新接管该节点)。
Parameters:
| Name |
Type |
Description |
usdPath |
string
|
USD Prim 路径 |
Returns:
是否成功
-
Type
-
Boolean
-
resolveNode(usdPath)
-
把 USD 路径解析成节点句柄。逐帧动画在首帧调用一次,之后把句柄交给 setNodeTransformsBatch,不再按名字查找。
Parameters:
| Name |
Type |
Description |
usdPath |
string
|
USD Prim 路径 |
Returns:
-
Type
-
Object
|
null
-
setClippingPlanes(value)
-
设置裁剪平面集合
Parameters:
| Name |
Type |
Description |
value |
ClippingPlaneCollection
|
裁剪平面集合 |
-
setMultiClippingPlanes(value)
-
设置多裁剪平面集合
Parameters:
| Name |
Type |
Description |
value |
MultiClippingPlaneCollection
|
多裁剪平面集合 |
-
-
实时设置单节点局部 TRS(对应 GSMMLayer 改 Child.TRS)。模型节点与关节统一经此控制节点位姿:
- Skeleton 蒙皮骨骼关节(bone)为参与蒙皮的节点,修改即可驱动蒙皮形变;
- UsdPhysics 约束关节 Prim 的位姿不驱动约束两侧刚体,转动请作用于 body1 部件节点或交给物理引擎。
未提供的分量取该节点当前局部值;立即写入 sceneGraph 运行时节点,后续可再调用 applyNodeTransforms() 汇总刷新。
Parameters:
| Name |
Type |
Description |
usdPath |
string
|
USD Prim 路径 |
trs |
Object
|
USDNodeTransformInput |
Returns:
是否设置成功(路径未解析返回 false;模型未就绪时先排队,applyNodeTransforms 后生效)
-
Type
-
Boolean
-
-
批量设置多个节点的局部 TRS(逐帧动画/整帧播放首选)。
与逐个 setNodeTransform 的区别:只写覆盖态,最后统一写运行时节点;
子树刷新按父子链去重(祖先已在本批时,后代由祖先的递归刷新覆盖),
因此同一帧内整条关节链只刷新一次,而不是每个节点各刷一遍。
Parameters:
| Name |
Type |
Description |
list |
Array.<Object>
|
批量项数组。节点用 path / usdPath / node_name,或首帧 resolveNode 得到的 node 句柄。
TRS 字段 translation / rotation / scale 与 setNodeTransform 一致 |
Returns:
实际写入运行时节点的数量
-
Type
-
number
-
setStyle(style)
-
设置模型高亮与轮廓样式
Parameters:
| Name |
Type |
Description |
style |
Object
|
样式对象
Properties
| Name |
Type |
Description |
modelColor |
Object
|
模型颜色
Properties
| Name |
Type |
Argument |
Default |
Description |
mode |
String
|
<optional>
|
"Highlight"
|
着色模式:Highlight | Replace | Mix |
color |
String
|
<optional>
|
"yellow"
|
模型颜色 |
mixAmount |
Number
|
<optional>
|
0.5
|
混合度,mode 为 Mix 时有效,取值 0~1 |
|
modelSilhouette |
Object
|
模型轮廓
Properties
| Name |
Type |
Argument |
Default |
Description |
color |
String
|
<optional>
|
"yellow"
|
轮廓颜色 |
size |
Number
|
<optional>
|
1
|
轮廓宽度(像素) |
|
|
-
-
根据当前 origin、offset、rotation、scale 更新模型变换,并触发 TRANSFORM_CHANGED
-
worldPositionToLayerENU(worldPosition)
-
将世界坐标转换为以图层原点为基准的东北天 ENU 偏移 (x=东, y=北, z=天)
Parameters:
| Name |
Type |
Description |
worldPosition |
Cartesian3
|
世界坐标 |
Returns:
ENU 偏移坐标
-
Type
-
Cartesian3
|
undefined
-
worldPositionToLocal(worldPosition)
-
将世界坐标转换为模型局部坐标
Parameters:
| Name |
Type |
Description |
worldPosition |
Cartesian3
|
世界坐标 |
Returns:
模型局部坐标
-
Type
-
Cartesian3
|
undefined