@JsType(isNative=true, namespace="Cesium", name="Model") public class Model extends Object
Scene.pick(org.cesiumjs.cs.core.Cartesian2)
and animatable with getNode(java.lang.String)
. glTF cameras and lights are not currently supported.
An external glTF asset is created with Model.fromGltf. glTF JSON can also be created at runtime and passed to
this constructor function. In either case, the readyPromise()
is resolved when the model is ready to render,
i.e., when the external binary, image, and shader files are downloaded and the WebGL resources are created.
For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the CESIUM_RTC_MODELVIEW
parameter semantic that says the node is in WGS84 coordinates translated relative to a local origin.Modifier and Type | Field and Description |
---|---|
ModelAnimationCollection |
activeAnimations
The currently playing glTF animations.
|
boolean |
clampAnimations
Determines if the model's animations should hold a pose over frames where no keyframes are specified.
|
ClippingPlaneCollection |
clippingPlane
The ClippingPlaneCollection used to selectively disable rendering the model.
|
Color |
color
A color that blends with the model's rendered color.
|
double |
colorBlendAmount
Value used to determine the color strength when the colorBlendMode is MIX.
|
Number |
colorBlendMode
Defines how the color blends with the model.
|
double |
debugShowBoundingVolume
This property is for debugging only; it is not for production use nor is it optimized.
|
boolean |
debugWireframe
This property is for debugging only; it is not for production use nor is it optimized.
|
DistanceDisplayCondition |
distanceDisplayCondition
Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
|
Object |
gltf
The object for the glTF JSON, including properties with default values omitted from the JSON provided to this model.
|
Object |
id
User-defined object returned when the model is picked.
|
boolean |
incrementallyLoadTextures
Determine if textures may continue to stream in after the model is loaded.
|
Cartesian3 |
lightColor
The color and intensity of the sunlight used to shade the model.
|
double |
luminanceAtZenith
The sun's luminance at the zenith in kilo candela per meter squared to use for this model's
procedural environment map.
|
double |
maximumScale
The maximum scale size for a model.
|
double |
minimumPixelSize
The approximate minimum pixel size of the model regardless of zoom.
|
Matrix4 |
modelMatrix
The 4x4 transformation matrix that transforms the model from model to world coordinates.
|
double |
scale
A uniform scale applied to this model before the Model#modelMatrix.
|
Number |
shadows
Determines whether the model casts or receives shadows from each light source.
|
boolean |
show
Determines if the model primitive will be shown.
|
Color |
silhouetteColor
The silhouette color.
|
double |
silhouetteSize
The size of the silhouette in pixels.
|
String |
specularEnvironmentMaps
A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
|
Cartesian3[] |
sphericalHarmonicCoefficients
The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
|
Constructor and Description |
---|
Model() |
Model(ModelOptions options) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowPicking()
When true, each glTF mesh and primitive is pickable with Scene#pick.
|
boolean |
asynchronous()
Determines if model WebGL resource creation will be spread out over several frames or block until
completion once all glTF files are loaded.
|
String |
basePath()
The base path that paths in the glTF JSON are relative to.
|
BoundingSphere |
boundingSphere()
The model's bounding sphere in its local coordinate system.
|
void |
destroy()
Destroys the WebGL resources held by this object.
|
static Model |
fromGltf(FromGltfOptions options)
Creates a model from a glTF asset.
|
ModelMaterial |
getMaterial(String name)
Returns the glTF material with the given name property.
|
ModelMesh |
getMesh(String name)
Returns the glTF mesh with the given name property.
|
ModelNode |
getNode(String name)
Returns the glTF node with the given name property.
|
boolean |
isDestroyed()
Returns true if this object was destroyed; otherwise, false.
|
double |
pendingTextureLoads()
Return the number of pending texture loads.
|
boolean |
ready()
When true, this model is ready to render, i.e., the external binary, image, and shader files were downloaded
and the WebGL resources were created.
|
Promise<Model,Void> |
readyPromise()
Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary,
image, and shader files were downloaded and the WebGL resources were created.
|
static boolean |
silhouetteSupported(Scene scene)
Determines if silhouettes are supported.
|
void |
update()
Called when
Viewer or CesiumWidget render the
scene to get the draw commands needed to render this primitive. |
@JsProperty public ModelAnimationCollection activeAnimations
@JsProperty public boolean clampAnimations
@JsProperty public Color color
Color.WHITE()
.@JsProperty public double colorBlendAmount
@JsProperty public Number colorBlendMode
ColorBlendMode.HIGHLIGHT()
.@JsProperty public double debugShowBoundingVolume
@JsProperty public boolean debugWireframe
@JsProperty public DistanceDisplayCondition distanceDisplayCondition
@JsProperty public Object gltf
@JsProperty public Object id
@JsProperty public boolean incrementallyLoadTextures
@JsProperty public Cartesian3 lightColor
@JsProperty public double luminanceAtZenith
specularEnvironmentMaps
and
sphericalHarmonicCoefficients
are not defined.
Default: 0.5@JsProperty public double maximumScale
minimumPixelSize
,
ensuring that the model is never an unreasonable scale.@JsProperty public double minimumPixelSize
@JsProperty public Matrix4 modelMatrix
Matrix4.IDENTITY()
.@JsProperty public double scale
@JsProperty public Number shadows
ShadowMode.ENABLED()
.@JsProperty public boolean show
@JsProperty public Color silhouetteColor
Color.RED()
.@JsProperty public double silhouetteSize
@JsProperty public ClippingPlaneCollection clippingPlane
@JsProperty public String specularEnvironmentMaps
sphericalHarmonicCoefficients
@JsProperty public Cartesian3[] sphericalHarmonicCoefficients
@JsConstructor public Model()
@JsConstructor public Model(ModelOptions options)
@JsProperty(name="allowPicking") public boolean allowPicking()
@JsProperty(name="asynchronous") public boolean asynchronous()
@JsProperty(name="basePath") public String basePath()
@JsProperty(name="boundingSphere") public BoundingSphere boundingSphere()
@JsProperty(name="pendingTextureLoads") public double pendingTextureLoads()
@JsProperty(name="ready") public boolean ready()
@JsProperty(name="readyPromise") public Promise<Model,Void> readyPromise()
ready()
@JsMethod public static Model fromGltf(FromGltfOptions options)
options
- @JsMethod public static boolean silhouetteSupported(Scene scene)
scene
- The scene.@JsMethod public void destroy()
isDestroyed()
@JsMethod public ModelMaterial getMaterial(String name)
name
- The glTF name of the material.@JsMethod public ModelMesh getMesh(String name)
name
- The glTF name of the mesh.@JsMethod public ModelNode getNode(String name)
name
- The glTF name of the node.@JsMethod public boolean isDestroyed()
destroy()
@JsMethod public void update()
Viewer
or CesiumWidget
render the
scene to get the draw commands needed to render this primitive.
Do not call this function directly.Copyright © 2019. All rights reserved.