MarkModel

MarkModel

基于 glTF 的3D模型。

Cesium包括对glTF几何,材质,动画和蒙皮的支持。当前不支持照相机和灯光。

Constructor

new MarkModel(options)

Author:
  • wsy
See:
Example
var plane = new MarkModel({
      uri : "../../../Apps/SampleData/models/CesiumAir/Cesium_Air.glb",
      position : new GeoPosition(116.405419, 39.918034, 10),
      distanceDisplayCondition : new Cesium.DistanceDisplayCondition(0.0, 1000000),
});
Parameters:
Name Type Description
options Object 拥有以下属性的对象:
Properties
Name Type Attributes Default Description
id String <optional>
指定标绘的唯一标识符。如果没有提供,则生成GUID。
name String <optional>
"" 指定标绘的名称,名称不必是唯一的。
show Boolean <optional>
true 指定标绘的可见性。
allowPicking Boolean <optional>
false 指定标绘是否可选中。
availability Cesium.TimeIntervalCollection <optional>
指定标绘在某段时间可用。
description String | Map <optional>
"" 指定描述这个标绘的HTML或Map键值对。
viewFrom Cesium.Cartesian3 <optional>
用于查看该标绘的建议初始偏移量。
distanceDisplayCondition Cesium.DistanceDisplayCondition <optional>
指定在距像机的某个距离内显示此标绘。
material Cesium.Color <optional>
Cesium.Color.WHITE 指定标绘的材质。
position GeoPosition 位置。
heading Number <optional>
航向(以角度为单位)。
pitch Number <optional>
俯仰角(以角度为单位)。
roll Number <optional>
翻滚角(以角度为单位)。
uri String <optional>
glTF资源路径。
scale Number <optional>
1.0 放大比例。
minimumPixelSize Number <optional>
0.0 用于指定模型的最小像素大小,而不考虑缩放。
maximumScale Number <optional>
模型最大比例尺大小. 在这个比例尺内模型模型大小缩放受minimumPixelSize限制,超过这个比例尺,不受minimumPixelSize限制。
incrementallyLoadTextures Boolean <optional>
true 设置在加载模型后纹理是否可以继续流入,默认是true。
runAnimations Boolean <optional>
true 指定是否应该启动模型中指定的gltf动画。
clampAnimations Boolean <optional>
true 指定glTF动画是否应在没有关键帧的持续时间内保持最后一个姿势。
shadows Cesium.ShadowMode <optional>
Cesium.ShadowMode.ENABLED 从每个光源投射或接收阴影的模式。
heightReference Cesium.HeightReference <optional>
Cesium.HeightReference.NONE 相对于地形的位置。
silhouetteColor Cesium.Color <optional>
Cesium.Color.RED 指定的模型边框颜色。
silhouetteSize Number <optional>
0.0 边框大小(像素)。
colorBlendMode Cesium.ColorBlendMode <optional>
Cesium.ColorBlendMode.HIGHLIGHT 指定颜色混合模式。
colorBlendAmount Number <optional>
0.5 混合模式的强度值。当colorBlendMode为Cesium.ColorBlendMode.MIX时有效,范围0-1,0表示不和颜色混合,1则表示替换。
imageBasedLightingFactor Cesium.Cartesian2 <optional>
new Cesium.Cartesian2(1.0, 1.0) 指定基于漫反射和镜面反射图像的照明的属性.
lightColor Cesium.Color <optional>
指定光源颜色。默认为 undefined
nodeTransformations Cesium.PropertyBag <optional>
一个对象,其中的键是节点的名称,而值是 TranslationRotationScale 属性,描述了要应用于该节点的转换。 转换是在glTF中指定的节点现有转换之后应用的,并且不会替换节点现有转换。(轮胎转动就需要该属性。)
articulations Cesium.PropertyBag <optional>
模型关节(见CZML Model articulation 示例)它的键由关节名称,单个空格和阶段名称组成,值是数字属性。
clippingPlanes Cesium.ClippingPlaneCollection <optional>
用于有选择地禁用渲染模型。

Extends

Members

allowPicking :Boolean

Overrides:
获取或设置标绘是否可选中。
Type:
  • Boolean

articulations :Cesium.PropertyBag

获取或设置模型关节(见CZML Model articulation 示例)它的键由关节名称,单个空格和阶段名称组成,值是数字属性。
Type:
  • Cesium.PropertyBag

availability :Cesium.TimeIntervalCollection

Overrides:
在指定的时间里可用。
Type:
  • Cesium.TimeIntervalCollection

(readonly) boundingSphereShow :Boolean

Overrides:
Default Value:
  • false
获取是否显示包围球。
Type:
  • Boolean

clampAnimations :Boolean

Default Value:
  • true
获取或设置glTF动画是否应在没有关键帧的持续时间内保持最后一个姿势。
Type:
  • Boolean

clippingPlanes :Cesium.ClippingPlaneCollection

获取或设置Cesium.ClippingPlaneCollection ,用于有选择地禁用渲染模型。
Type:
  • Cesium.ClippingPlaneCollection

colorBlendAmount :Number

Default Value:
  • 0.5
获取或设置混合模式的强度值。当colorBlendMode为Cesium.ColorBlendMode.MIX时有效,范围0-1,0表示不和颜色混合,1则表示替换。
Type:
  • Number

colorBlendMode :Cesium.ColorBlendMode

Default Value:
  • Cesium.ColorBlendMode.HIGHLIGHT
获取或设置颜色混合模式。
Type:
  • Cesium.ColorBlendMode

description :String|Map

Overrides:
Default Value:
  • ""
获取或设置描述这个标绘的HTML或Map键值对。
Type:
  • String | Map

distanceDisplayCondition :Cesium.DistanceDisplayCondition

Overrides:
在距像机的某个距离内显示。
Type:
  • Cesium.DistanceDisplayCondition

heading :Number

Overrides:
Default Value:
  • 0.0
获取/设置标绘实体偏航角。
Type:
  • Number

heightReference :Cesium.HeightReference

Default Value:
  • Cesium.HeightReference.NONE
获取或设置相对于地形的位置。
Type:
  • Cesium.HeightReference

(readonly) id :String

Overrides:
获取标绘实体的ID。
Type:
  • String

imageBasedLightingFactor :Cesium.Cartesian2

Default Value:
  • new Cesium.Cartesian2(1.0, 1.0)
获取或设置基于漫反射和镜面反射图像的照明的属性。
Type:
  • Cesium.Cartesian2

incrementallyLoadTextures :Boolean

Default Value:
  • true
获取或设置在加载模型后纹理是否可以继续流入,默认是true。
Type:
  • Boolean

lightColor :Cesium.Color

获取或设置光源颜色。默认为 undefined
Type:
  • Cesium.Color

material :MarkMaterial|Cesium.Color

Overrides:
Default Value:
  • Cesium.Color.WHITE
获取或设置标绘的材质。
Type:

maximumScale :Boolean

获取或设置模型最大比例尺大小。在这个比例尺内模型模型大小缩放受minimumPixelSize限制,超过这个比例尺,不受minimumPixelSize限制。
Type:
  • Boolean

minimumPixelSize :Number

Default Value:
  • 0.0
获取或设置模型的最小像素大小,而不考虑缩放。
Type:
  • Number

name :String

Overrides:
获取或设置标绘实体的名称。
Type:
  • String

nodeTransformations :Cesium.PropertyBag

获取或设置PropertyBag对象,其中的键是节点的名称,而值是 Cesium.TranslationRotationScale 属性,描述了要应用于该节点的转换。 转换是在glTF中指定的节点现有转换之后应用的,并且不会替换节点现有转换。(轮胎转动就需要该属性。)。
Type:
  • Cesium.PropertyBag

pitch :Number

Overrides:
Default Value:
  • 0.0
获取/设置标绘实体俯仰角。
Type:
  • Number

position :GeoPosition

Overrides:
获取或设置标绘实体位置。
Type:

ready

Overrides:
获取是否已经准备就绪好下一次渲染。

roll :Number

Overrides:
Default Value:
  • 0.0
获取/设置标绘实体翻滚角。
Type:
  • Number

runAnimations :Boolean

Default Value:
  • true
获取或设置是否应该启动模型中指定的gltf动画。
Type:
  • Boolean

scale :Number

Default Value:
  • 1.0
获取或设置模型放大比例。
Type:
  • Number

shadows :Cesium.ShadowMode

Default Value:
  • Cesium.ShadowMode.ENABLED
获取或设置从每个光源投射或接收阴影的模式。
Type:
  • Cesium.ShadowMode

show :Boolean

Overrides:
Default Value:
  • true
获取或设置标绘实体的显示或隐藏。
Type:
  • Boolean

silhouetteColor :Cesium.Color

Default Value:
  • Cesium.Color.RED
获取或设置模型边框颜色。
Type:
  • Cesium.Color

silhouetteSize :Number

Default Value:
  • 0.0
获取或设置边框大小(像素)。
Type:
  • Number

uri :String

获取或设置资源路径。
Type:
  • String

viewFrom :Cesium.Cartesian3

Overrides:
Default Value:
  • undefined
查看该标绘实例的建议初始偏移量。
Type:
  • Cesium.Cartesian3

Methods

getBoundingSphere(viewer) → {Cesium.BoundingSphere}

Overrides:
获取此标绘实例的包围球。使用时必须调用getReadyPromise()方法。
Example
// box为已经创建好的Mark
box.getReadyPromise(viewer).then(function(box){
     console.log(box.getBoundingSphere(viewer));
})
Parameters:
Name Type Description
viewer Cesium.Viewer Cesium可视化器。
Returns:
获取的包围球。
Type
Cesium.BoundingSphere

getReadyPromise(viewer) → {Promise.Mark}

Overrides:
获取ReadyPromise
Parameters:
Name Type Description
viewer Cesium.Viewer
Returns:
Type
Promise.Mark

showBoundingSphere(viewer, show)

Overrides:
设置是否显示包围球。
Parameters:
Name Type Description
viewer Cesium.Viewer Cesium可视化器。
show Boolean 是否显示包围球。