main.cesium.SphereGeometry.kt Maven / Gradle / Ivy
// Automatically generated - do not modify!
@file:JsModule("cesium")
@file:Suppress(
"NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)
package cesium
/**
* A description of a sphere centered at the origin.
* ```
* const sphere = new SphereGeometry({
* radius : 100.0,
* vertexFormat : VertexFormat.POSITION_ONLY
* });
* const geometry = SphereGeometry.createGeometry(sphere);
* ```
* @see Online Documentation
*/
external class SphereGeometry(options: ConstructorOptions? = definedExternally) {
/**
* @property [radius] The radius of the sphere.
* Default value - `1.0`
* @property [stackPartitions] The number of times to partition the ellipsoid into stacks.
* Default value - `64`
* @property [slicePartitions] The number of times to partition the ellipsoid into radial slices.
* Default value - `64`
* @property [vertexFormat] The vertex attributes to be computed.
* Default value - [VertexFormat.DEFAULT]
*/
interface ConstructorOptions {
var radius: Double?
var stackPartitions: Int?
var slicePartitions: Int?
var vertexFormat: VertexFormat?
}
companion object : Packable {
/**
* The number of elements used to pack the object into an array.
* @see Online Documentation
*/
override val packedLength: Int
/**
* Stores the provided instance into the provided array.
* @param [value] The value to pack.
* @param [array] The array to pack into.
* @param [startingIndex] The index into the array at which to start packing the elements.
* Default value - `0`
* @return The array that was packed into
* @see Online Documentation
*/
override fun pack(
value: SphereGeometry,
array: Array,
startingIndex: Int?,
): Array
/**
* Retrieves an instance from a packed array.
* @param [array] The packed array.
* @param [startingIndex] The starting index of the element to be unpacked.
* Default value - `0`
* @param [result] The object into which to store the result.
* @return The modified result parameter or a new SphereGeometry instance if one was not provided.
* @see Online Documentation
*/
override fun unpack(
array: Array,
startingIndex: Int?,
result: SphereGeometry?,
): SphereGeometry
/**
* Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
* @param [sphereGeometry] A description of the sphere.
* @return The computed vertices and indices.
* @see Online Documentation
*/
fun createGeometry(sphereGeometry: SphereGeometry): Geometry?
}
}
inline fun SphereGeometry(
block: SphereGeometry.ConstructorOptions.() -> Unit,
): SphereGeometry {
val options: SphereGeometry.ConstructorOptions = js("({})")
block(options)
return SphereGeometry(options)
}