Struct reverie_engine_opengl::vao::buffer::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>)

頂点群を追加する

  • v - 頂点の情報がフラットに繰り返されるVec。したがってv.len()は[VERTEX_SIZE]の倍数になる。 ※頂点情報の仕様については[VERTEX_SIZE]を参照
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

§

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

§

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

§

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.