All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.cesium.DebugCameraPrimitive.kt Maven / Gradle / Ivy

The newest version!
// Automatically generated - do not modify!

@file:JsModule("cesium")

@file:Suppress(
    "NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)

package cesium

/**
 * Draws the outline of the camera's view frustum.
 * ```
 * primitives.add(new DebugCameraPrimitive({
 *   camera : camera,
 *   color : Color.YELLOW
 * }));
 * ```
 * @see Online Documentation
 */
external class DebugCameraPrimitive(options: ConstructorOptions) {
    /**
     * @property [camera] The camera.
     * @property [frustumSplits] Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
     * @property [color] The color of the debug outline.
     *   Default value - [Color.CYAN]
     * @property [updateOnChange] Whether the primitive updates when the underlying camera changes.
     *   Default value - `true`
     * @property [show] Determines if this primitive will be shown.
     *   Default value - `true`
     * @property [id] A user-defined object to return when the instance is picked with [Scene.pick].
     */
    interface ConstructorOptions {
        var camera: Camera
        var frustumSplits: Array?
        var color: Color?
        var updateOnChange: Boolean?
        var show: Boolean?
        var id: Any?
    }

    /**
     * Determines if this primitive will be shown.
     * @see Online Documentation
     */
    var show: Boolean

    /**
     * User-defined value returned when the primitive is picked.
     * @see Online Documentation
     */
    var id: Any

    /**
     * Returns true if this object was destroyed; otherwise, false.
     *
     * If this object was destroyed, it should not be used; calling any function other than
     * `isDestroyed` will result in a [DeveloperError] exception.
     * @return `true` if this object was destroyed; otherwise, `false`.
     * @see Online Documentation
     */
    fun isDestroyed(): Boolean

    /**
     * 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
     * `isDestroyed` will result in a [DeveloperError] exception.  Therefore,
     * assign the return value (`undefined`) to the object as done in the example.
     * ```
     * p = p && p.destroy();
     * ```
     * @see Online Documentation
     */
    fun destroy()
}

inline fun DebugCameraPrimitive(
    block: DebugCameraPrimitive.ConstructorOptions.() -> Unit,
): DebugCameraPrimitive {
    val options: DebugCameraPrimitive.ConstructorOptions = js("({})")
    block(options)
    return DebugCameraPrimitive(options)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy