class SceneMesh
SceneMesh
(
handle
)
| |
SceneMesh
(
filename
, defaultShaderOverride
, defaultSceneOverride
)
|
Signature
constructor(filename: String, defaultShaderOverride: String, defaultSceneOverride: Int = -1) Parameters
filename:
String
defaultShaderOverride:
String
defaultSceneOverride:
Int
Returns |
animationNameToTrack
: Map
[Get] |
Signature
val animationNameToTrack: Map<String, Int> |
associatedFiles
: Array?
[Get] |
Signature
var associatedFiles: Array |
handle
: Long
[Get] |
Signature
var handle: Long |
materials
: Array?
[Get] |
Signature
var materials: Array<SceneMaterial>? |
nodeNameToId
: Map
[Get] |
Signature
val nodeNameToId: Map<String, Int> |
calculateNodeGlobalMatrix
(
index
)
|
Calculates the global transformation matrix of a node.
Signature
fun calculateNodeGlobalMatrix(index: Int): Matrix44 Parameters
index:
Int
|
computeCombinedBounds
()
|
Computes the combined bounding box of all geometry in this mesh.
Signature
fun computeCombinedBounds(): Bound3D |
destroy
()
|
Signature
fun destroy() |
getAnimationTracks
()
|
Gets all animation tracks defined in this mesh.
Signature
fun getAnimationTracks(): Array<AnimationTrack> Returns
Array
|
getMaterial
(
index
)
|
Gets a material from this mesh by index. This material is the "parent" of any SceneObjects instanced from this mesh. Any changes to attributes will apply to the non-overridden properties of the child materials.
If you know the name of the material, you can get the index from SceneMesh.getMaterialIndex()
Signature
fun getMaterial(index: Int): SceneMaterial? Parameters
index:
Int
|
getMaterial
(
material
)
|
Gets a material by name. This material is the "parent" of any SceneObjects instanced from this mesh. Any changes to attributes will apply to the non-overridden properties of the child materials.
Signature
fun getMaterial(material: String): SceneMaterial? Parameters
material:
String
|
getMaterialIndex
(
material
)
|
Gets the index of a material by name.
Signature
fun getMaterialIndex(material: String): Int Parameters
material:
String
Returns
Int
|
getMaterialIndexForNodeMeshElement
(
nodeId
, meshElementId
)
|
Gets the material index for a specific node and mesh element.
Signature
fun getMaterialIndexForNodeMeshElement(nodeId: Int, meshElementId: Int): Int Parameters
nodeId:
Int
meshElementId:
Int
Returns
Int
|
getMaterialName
(
materialIndex
)
|
Gets the name of a material by index.
Signature
fun getMaterialName(materialIndex: Int): String Parameters
materialIndex:
Int
Returns
String
|
getNodeCount
()
|
Gets the number of nodes in this mesh.
Signature
fun getNodeCount(): Int Returns
Int
|
getNodeIndex
(
name
)
|
Gets the index of a node by name.
Signature
fun getNodeIndex(name: String): Int Parameters
name:
String
Returns
Int
|
getNodeLocalMatrix
(
index
)
|
Gets the local transformation matrix of a node.
Signature
fun getNodeLocalMatrix(index: Int): Matrix44 Parameters
index:
Int
|
getNodeName
(
index
)
|
Gets the name of a node by index.
Signature
fun getNodeName(index: Int): String Parameters
index:
Int
Returns
String
|
updateCylinderSurface
(
radius
, height
, fractionOfCircle
)
|
Updates the geometry of a cylinder surface mesh.
Signature
fun updateCylinderSurface(radius: Float, height: Float, fractionOfCircle: Float) Parameters
radius:
Float
height:
Float
fractionOfCircle:
Float
|
updateWithTriangleMesh
(
triMesh
, updateBVH
)
|
Updates this mesh with geometry from a triangle mesh.
Signature
fun updateWithTriangleMesh(triMesh: TriangleMesh, updateBVH: Boolean = false) Parameters
updateBVH:
Boolean
|
axis
(
size
, thickness
, material
)
|
Creates a coordinate axis visualization mesh.
Signature
fun axis(size: Float, thickness: Float, material: SceneMaterial): SceneMesh Parameters
size:
Float
thickness:
Float
|
box
(
minx
, miny
, minz
, maxx
, maxy
, maxz
, material
)
|
Creates a box mesh with the specified dimensions and material.
Signature
fun box(minx: Float, miny: Float, minz: Float, maxx: Float, maxy: Float, maxz: Float, material: SceneMaterial): SceneMesh Parameters
minx:
Float
miny:
Float
minz:
Float
maxx:
Float
maxy:
Float
maxz:
Float
|
box
(
min
, max
, material
)
|
Creates a box mesh with the specified bounds and material.
Signature
fun box(min: Vector3, max: Vector3, material: SceneMaterial): SceneMesh Parameters |
cylinderSurface
(
radius
, height
, fractionOfCircle
, material
, materialBack
)
|
Creates a portion of a cylinder centered at (0, 0, 0) that is a single sided surface facing inwards. This cylinder is symmetric about the XZ plane.
Signature
fun cylinderSurface(radius: Float, height: Float, fractionOfCircle: Float, material: SceneMaterial, materialBack: SceneMaterial? = null): SceneMesh Parameters
radius:
Float
height:
Float
fractionOfCircle:
Float
|
dome
(
radius
, material
)
|
Creates a dome mesh (half-sphere) with the specified radius and material.
Signature
fun dome(radius: Float, material: SceneMaterial): SceneMesh Parameters
radius:
Float
|
equirectSurface
(
radius
, centralHorizontalAngle
, upperVerticalAngle
, lowerVerticalAngle
, material
)
|
Creates an inward portion of a sphere centered at (0, 0, 0). Uses a parameterization similar to OpenXR's equirect2 layers.
Signature
fun equirectSurface(radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float, material: SceneMaterial): SceneMesh Parameters
radius:
Float
centralHorizontalAngle:
Float
upperVerticalAngle:
Float
lowerVerticalAngle:
Float
material:
SceneMaterial Returns |
fromTriangleMesh
(
mesh
, createBVH
)
|
Creates a mesh from a triangle mesh.
Signature
fun fromTriangleMesh(mesh: TriangleMesh, createBVH: Boolean): SceneMesh Parameters
mesh:
TriangleMesh
createBVH:
Boolean
|
loadLocalFile
(
filename
, defaultShaderOverride
, defaultSceneOverride
)
|
Loads a 3D model from a glTF file.
Signature
fun loadLocalFile(filename: String, defaultShaderOverride: String = "", defaultSceneOverride: Int = -1): SceneMesh Parameters
filename:
String
defaultShaderOverride:
String
defaultSceneOverride:
Int
|
loadLocalFile
(
filename
, materials
, defaultSceneOverride
)
|
Loads a 3D model from a glTF file.
Signature
fun loadLocalFile(filename: String, materials: List<SceneMaterial>, defaultSceneOverride: Int = -1): SceneMesh Parameters
filename:
String
materials:
List
defaultSceneOverride:
Int
|
meshWithMaterials
(
positions
, normals
, uvs
, colors
, indices
, materialRanges
, materials
, createBVH
)
|
Creates a custom mesh with the specified geometry data and materials.
Signature
fun meshWithMaterials(positions: FloatArray, normals: FloatArray, uvs: FloatArray, colors: IntArray, indices: IntArray, materialRanges: IntArray, materials: Array<SceneMaterial>, createBVH: Boolean): SceneMesh Parameters
positions:
FloatArray
normals:
FloatArray
uvs:
FloatArray
colors:
IntArray
indices:
IntArray
materialRanges:
IntArray
materials:
Array
createBVH:
Boolean
|
meshWithMaterials
(
positions
, normals
, uvs
, uv1s
, colors
, indices
, materialRanges
, materials
, createBVH
)
|
Signature
fun meshWithMaterials(positions: FloatArray, normals: FloatArray, uvs: FloatArray, uv1s: FloatArray, colors: IntArray, indices: IntArray, materialRanges: IntArray, materials: Array<SceneMaterial>, createBVH: Boolean): SceneMesh Parameters
positions:
FloatArray
normals:
FloatArray
uvs:
FloatArray
uv1s:
FloatArray
colors:
IntArray
indices:
IntArray
materialRanges:
IntArray
materials:
Array
createBVH:
Boolean
Returns |
panel
(
min
, max
, edgeRadius
, materialPanel
, materialGlass
)
|
Creates a panel mesh with a glass frame.
Signature
fun panel(min: Vector3, max: Vector3, edgeRadius: Vector3, materialPanel: SceneMaterial, materialGlass: SceneMaterial): SceneMesh Parameters
edgeRadius:
Vector3 |
quad
(
min
, max
, material
)
|
Creates a single-sided quad (flat rectangle) mesh with the specified bounds and material.
Signature
fun quad(min: Vector3, max: Vector3, material: SceneMaterial): SceneMesh Parameters |
roundedBox
(
min
, max
, edgeRadius
, material
)
|
Creates a box with rounded corners.
Signature
fun roundedBox(min: Vector3, max: Vector3, edgeRadius: Vector3, material: SceneMaterial): SceneMesh Parameters
edgeRadius:
Vector3 |
singleSidedQuad
(
halfWidth
, halfHeight
, material
)
|
Creates a single-sided quad mesh with the specified dimensions and material.
Signature
fun singleSidedQuad(halfWidth: Float, halfHeight: Float, material: SceneMaterial): SceneMesh Parameters |
skybox
(
radius
, material
)
|
Creates a skybox mesh with the specified radius and material.
A skybox is a large sphere or cube that surrounds the scene and displays a background environment.
Signature
fun skybox(radius: Float, material: SceneMaterial): SceneMesh Parameters
radius:
Float
|
sphere
(
radius
, material
)
|
Creates a sphere mesh with the specified radius and material.
Signature
fun sphere(radius: Float, material: SceneMaterial): SceneMesh Parameters
radius:
Float
|