Struct VaoBuffer

Source
pub struct VaoBuffer<V: VertexType> { /* private fields */ }
Expand description

頂点の情報を動的に追加・削除するためのバッファ

Implementations§

Source§

impl<V: VertexType> VaoBuffer<V>

Source

pub fn new() -> Self

空のVaoBufferを作る

Source

pub fn with_num_vertex(num_vertex_to_reserve: usize) -> Self

初期のバッファーサイズを指定してVaoBufferを作る

num_vertex_to_reserve個の頂点が確保できるだけの初期容量になる。

Source

pub fn append(&mut self, v: &mut Vec<f32>)

頂点群を追加する

Source

pub fn clear(&mut self)

すべての頂点を削除する

Source

pub fn shrink(&mut self)

バッファの余分な容量をできるだけ縮める

Source

pub fn reserve(&mut self, additional_num_vertex: usize)

バッファの容量を予め確保する

少なくともadditional_num_vertex個の頂点が格納できるように確保する。

Source

pub fn clear_preserving_first(&mut self, num_vertex_to_preserve: usize)

先頭のnum_vertex_to_preserve個の頂点以外の頂点を削除する

Source

pub fn build<'a>(&self, gl: &Gl, config: &'a VaoConfig) -> Vao<'a>

現在のバッファの内容をもとにVaoを作る

Trait Implementations§

Source§

impl<V: Debug + VertexType> Debug for VaoBuffer<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V: VertexType> Default for VaoBuffer<V>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder2DGui<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>

Source§

fn add_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, dst: &Rect<i32, u32>, )

Source§

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, )

Source§

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>

Source§

fn add_cuboid( &mut self, begin: &Point3, end: &Point3, textures: &CuboidTextures<'_, TextureUV<Width, Height, AtlasWidth, AtlasHeight>>, )

各辺が軸に並行な直方体を追加する Read more
Source§

fn add_face( &mut self, p1: &Point3, p2: &Point3, p3: &Point3, p4: &Point3, uv: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, )

各辺が軸に並行な長方形を追加する Read more
Source§

fn add_octahedron( &mut self, center: &Point3, r: f32, uv: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, )

正八面体を追加する Read more
Source§

impl VaoBuilder3DGeometryOutline for VaoBuffer<VertexWithColor>

Source§

fn add_cuboid_outline( &mut self, begin: &Point3<f32>, end: &Point3<f32>, r: f32, g: f32, b: f32, )

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.