Package-level declarations
Functions
Link copied to clipboard
fun FilamentSceneScope.Cube(material: MaterialInstance, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), size: Float = 1.0f, onCreate: (Entity) -> Unit = {})
A unit cube centered on the origin (in mesh space). Six faces, 24 vertices (4 per face so normals and UVs are not shared across edges), 12 triangles.
Link copied to clipboard
fun FilamentSceneScope.Cylinder(material: MaterialInstance, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), radius: Float = 0.5f, height: Float = 1.0f, segments: Int = 32, onCreate: (Entity) -> Unit = {})
A right circular cylinder aligned with the Y axis, centered on the origin (top at +height/2, bottom at -height/2). Side wall + two end caps. segments controls the radial subdivision.
Link copied to clipboard
fun FilamentSceneScope.Mesh(material: MaterialInstance, positions: FloatArray, normals: FloatArray, uvs: FloatArray, indices: IntArray, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), boundingBox: Box? = null, onCreate: (Entity) -> Unit = {})
Link copied to clipboard
fun FilamentSceneScope.Plane(material: MaterialInstance, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), width: Float = 1.0f, depth: Float = 1.0f, doubleSided: Boolean = true, onCreate: (Entity) -> Unit = {})
A flat quad lying in the XZ plane centered on the origin. The mesh is two-sided by default: we emit a full set of vertices/triangles for both the +Y face and the -Y face with correctly oriented normals, so lighting works from above and below without disabling face culling or requiring a doubleSided material.
Link copied to clipboard
fun FilamentSceneScope.Sphere(material: MaterialInstance, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), radius: Float = 0.5f, rings: Int = 16, segments: Int = 32, onCreate: (Entity) -> Unit = {})