pub struct Geom<T> {
pub name: Option<String>,
pub material: Option<String>,
pub count: usize,
pub inputs: InputList,
pub data: T,
pub extra: Vec<Extra>,
}
Expand description
The common data for the geometry types:
Lines
= Geom<
LineGeom
>
LineStrips
= Geom<
LineStripGeom
>
Polygons
= Geom<
PolygonGeom
>
PolyList
= Geom<
PolyListGeom
>
Triangles
= Geom<
TriangleGeom
>
TriFans
= Geom<
TriFanGeom
>
TriStrips
= Geom<
TriStripGeom
>
Fields§
§name: Option<String>
The text string name of this element.
material: Option<String>
Declares a symbol for a material.
This symbol is bound to a material at the time of instantiation;
see Instance<Geometry>
and BindMaterial
.
If not specified then the lighting and shading results are application defined.
count: usize
The number of line/triangle/polygon primitives.
inputs: InputList
The vertex attribute access information.
data: T
The specific data for the geometry element.
extra: Vec<Extra>
Provides arbitrary additional information about this element.
Implementations§
Source§impl<T> Geom<T>
impl<T> Geom<T>
Sourcepub fn importer<'a, R: UrlResolver<'a, Source>>(
&'a self,
res: &R,
vimp: VertexImporter<'a>,
) -> Result<Importer<'a>, R::Error>
pub fn importer<'a, R: UrlResolver<'a, Source>>( &'a self, res: &R, vimp: VertexImporter<'a>, ) -> Result<Importer<'a>, R::Error>
Construct an Importer
from a VertexImporter
and a UrlResolver
.
Source§impl Geom<LineGeom>
impl Geom<LineGeom>
Sourcepub fn new(
material: Option<String>,
inputs: Vec<InputS>,
count: usize,
prim: Box<[u32]>,
) -> Self
pub fn new( material: Option<String>, inputs: Vec<InputS>, count: usize, prim: Box<[u32]>, ) -> Self
Construct a new Lines
object from a data buffer.
The data buffer prim
contains exactly count
lines, consisting of 2 vertices,
each consisting of inputs.len()
indices,
for a total of inputs.len() * 2 * count
values.
Source§impl Geom<LineStripGeom>
impl Geom<LineStripGeom>
Source§impl Geom<PolygonGeom>
impl Geom<PolygonGeom>
Source§impl Geom<PolyListGeom>
impl Geom<PolyListGeom>
Source§impl Geom<TriangleGeom>
impl Geom<TriangleGeom>
Sourcepub fn new(
material: Option<String>,
inputs: Vec<InputS>,
count: usize,
prim: Box<[u32]>,
) -> Self
pub fn new( material: Option<String>, inputs: Vec<InputS>, count: usize, prim: Box<[u32]>, ) -> Self
Construct a new Triangles
object from a data buffer.
The data buffer prim
contains exactly count
triangles, consisting of 3 vertices,
each consisting of inputs.len()
indices,
for a total of inputs.len() * 3 * count
values.