视口对齐的四边形。 A viewport aligned quad.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
rectangle |
BoundingRectangle |
可选 optional
The BoundingRectangle 定义四边形在视口中的位置。 defining the quad's position within the viewport. |
material |
Material |
可选 optional
The Material 定义视口四边形的表面外观。 defining the surface appearance of the viewport quad. |
示例: Example:
const viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
成员 Members
material : Material
四边形视口的表面外观。这可以是几个内置的之一 The surface appearance of the viewport quad. This can be one of several built-in
Material 对象或自定义材质,编写脚本 objects or a custom material, scripted with
Fabric.
默认材质是 The default material is Material.ColorType.
示例: Example:
// 1. Change the color of the default material to yellow
viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
// 2. Change material to horizontal stripes
viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);
另见: See:
定义四边形在视口内的位置的 BoundingRectangle。 The BoundingRectangle defining the quad's position within the viewport.
示例: Example:
viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
确定是否显示视口四元组图元。 Determines if the viewport quad primitive will be shown.
-
默认值: Default Value:
true
方法 Methods
销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
一旦对象被销毁,就不应再使用;调用除 Once an object is destroyed, it should not be used; calling any function other than
一旦对象被销毁,就不应再使用;调用除 Once an object is destroyed, it should not be used; calling any function other than
isDestroyed 将导致 will result in a DeveloperError 例外。因此,分配返回值( exception. Therefore, assign the return value (undefined) 到对象,如示例中所做的那样。 ) to the object as done in the example.
抛出: Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
示例: Example:
quad = quad && quad.destroy();
另见: See:
如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.
如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than
如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than
isDestroyed 将导致 will result in a DeveloperError exception.
返回: Returns:
如果该对象被销毁,则为 True;否则为假。 True if this object was destroyed; otherwise, false.
另见: See:
调用时间 Called when
Viewer or CesiumWidget 渲染场景以获取渲染此图元所需的绘制命令。 render the scene to get the draw commands needed to render this primitive.
不要直接调用该函数。记录此内容只是为了列出渲染场景时可能传播的异常: Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:
抛出: Throws:
-
DeveloperError :必须定义 this.material。 : this.material must be defined.
-
DeveloperError :必须定义 this.rectangle。 : this.rectangle must be defined.
