pub struct CreateMesh {
pub world: WorldId,
pub scope: Option<u64>,
pub source: Option<u64>,
pub positions: Vec<[f32; 3]>,
pub uvs: Option<Vec<[f32; 2]>>,
pub colors: Option<Vec<[u8; 4]>>,
pub normals: Option<Vec<[f32; 3]>>,
pub indices: Option<Vec<u32>>,
pub transform: Option<MeshTransform>,
pub color: Option<[f32; 4]>,
pub cutoff: Option<f32>,
pub hull_width: Option<f32>,
}mcp and non-WebAssembly only.Expand description
Arguments for creating a mesh.
Fields§
§world: WorldIdThe world to drive: "Host" for the world the transport thread itself
holds, or {"Handle": bits} for a world a host entity carries.
scope: Option<u64>The scope to spawn into, as its u64 bits. Omit for the entity
carrying the mesh source.
source: Option<u64>The entity carrying the world’s mesh source, as its u64 bits. Omit
for the world’s only one.
positions: Vec<[f32; 3]>Vertex positions, three floats each.
uvs: Option<Vec<[f32; 2]>>Vertex UVs, two floats each.
colors: Option<Vec<[u8; 4]>>Vertex colours, RGBA bytes each.
normals: Option<Vec<[f32; 3]>>Vertex normals, three floats each. Omit to shade the surface by the normals its positions give it.
indices: Option<Vec<u32>>Triangle indices.
transform: Option<MeshTransform>The entity’s transform.
color: Option<[f32; 4]>The instance colour; opaque white by default.
cutoff: Option<f32>The alpha cutoff, when the mesh should be cut out.
hull_width: Option<f32>How far the mesh’s inverted hull is pushed along its normals, in world units. Spawning one entity with this width beside a plain draw of the same mesh is what outlines it; an entity without it draws no hull.
Trait Implementations§
Source§impl Debug for CreateMesh
impl Debug for CreateMesh
Source§impl<'de> Deserialize<'de> for CreateMesh
impl<'de> Deserialize<'de> for CreateMesh
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for CreateMesh
impl JsonSchema for CreateMesh
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more