pub struct LineRenderer { /* private fields */ }Expand description
线段渲染器
使用 PrimitiveTopology::LineList 渲染 3D 线段。
支持单帧动态线段列表,每帧重新上传顶点数据。
Implementations§
Source§impl LineRenderer
impl LineRenderer
Sourcepub fn new(device: &RenderDevice, format: TextureFormat) -> Self
pub fn new(device: &RenderDevice, format: TextureFormat) -> Self
Sourcepub fn render(
&mut self,
device: &RenderDevice,
encoder: &mut CommandEncoder,
target: &TextureView,
lines: &[(Vec3, Vec3, Vec3)],
view_proj: &Mat4,
)
pub fn render( &mut self, device: &RenderDevice, encoder: &mut CommandEncoder, target: &TextureView, lines: &[(Vec3, Vec3, Vec3)], view_proj: &Mat4, )
渲染线段列表
§参数
device: GPU 渲染设备encoder: 命令编码器target: 渲染目标纹理视图lines: 线段列表,每项为(start, end, color)的 RGB 颜色view_proj: 视图-投影矩阵
Auto Trait Implementations§
impl !Freeze for LineRenderer
impl !RefUnwindSafe for LineRenderer
impl Send for LineRenderer
impl Sync for LineRenderer
impl Unpin for LineRenderer
impl UnsafeUnpin for LineRenderer
impl !UnwindSafe for LineRenderer
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.