pub struct VaoBuffer<V: VertexType> { /* private fields */ }
Expand description
頂点の情報を動的に追加・削除するためのバッファ
Implementations§
Source§impl<V: VertexType> VaoBuffer<V>
impl<V: VertexType> VaoBuffer<V>
Sourcepub fn with_num_vertex(num_vertex_to_reserve: usize) -> Self
pub fn with_num_vertex(num_vertex_to_reserve: usize) -> Self
初期のバッファーサイズを指定してVaoBuffer
を作る
num_vertex_to_reserve
個の頂点が確保できるだけの初期容量になる。
Sourcepub fn append(&mut self, v: &mut Vec<f32>)
pub fn append(&mut self, v: &mut Vec<f32>)
頂点群を追加する
v
- 頂点の情報がフラットに繰り返されるVec
。したがってv.len()
はVertexType::vertex_size()
の倍数になる。※頂点情報の仕様についてはVertexType::vertex_size()
を参照
Sourcepub fn reserve(&mut self, additional_num_vertex: usize)
pub fn reserve(&mut self, additional_num_vertex: usize)
バッファの容量を予め確保する
少なくともadditional_num_vertex
個の頂点が格納できるように確保する。
Sourcepub fn clear_preserving_first(&mut self, num_vertex_to_preserve: usize)
pub fn clear_preserving_first(&mut self, num_vertex_to_preserve: usize)
先頭のnum_vertex_to_preserve
個の頂点以外の頂点を削除する
Trait Implementations§
Source§impl<V: VertexType> Default for VaoBuffer<V>
impl<V: VertexType> Default for VaoBuffer<V>
Source§impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder2DGui<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>
impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder2DGui<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>
fn add_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, dst: &Rect<i32, u32>, )
fn add_layout_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, parent_width: u32, parent_height: u32, origin: &Origin, position_x: &Position<i32>, position_y: &Position<i32>, inner_width: u32, inner_height: u32, )
fn add_biggest_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, parent_width: u32, parent_height: u32, inner_width: u32, inner_height: u32, )
Source§impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder3DGeometry<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>
impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder3DGeometry<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>
Source§fn add_cuboid(
&mut self,
begin: &Point3,
end: &Point3,
textures: &CuboidTextures<'_, TextureUV<Width, Height, AtlasWidth, AtlasHeight>>,
)
fn add_cuboid( &mut self, begin: &Point3, end: &Point3, textures: &CuboidTextures<'_, TextureUV<Width, Height, AtlasWidth, AtlasHeight>>, )
各辺が軸に並行な直方体を追加する Read more
Auto Trait Implementations§
impl<V> Freeze for VaoBuffer<V>
impl<V> RefUnwindSafe for VaoBuffer<V>where
V: RefUnwindSafe,
impl<V> Send for VaoBuffer<V>where
V: Send,
impl<V> Sync for VaoBuffer<V>where
V: Sync,
impl<V> Unpin for VaoBuffer<V>where
V: Unpin,
impl<V> UnwindSafe for VaoBuffer<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.