[−][src]Struct turbine_scene3d::Scene
Stores scene data.
Fields
settings: SceneSettings
Scene settings.
projection: Matrix4<f32>
Projection transform.
camera: Matrix4<f32>
Camera transform.
model: Matrix4<f32>
Model transform.
Implementations
impl Scene
[src]
pub fn new(settings: SceneSettings) -> Scene
[src]
Create new scene.
pub fn projection(&mut self, p: Matrix4<f32>)
[src]
Set projection matrix.
pub fn camera(&mut self, c: Matrix4<f32>)
[src]
Set camera matrix.
pub fn model(&mut self, m: Matrix4<f32>)
[src]
Set model matrix.
pub fn load_texture<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<Texture, ImageError>
[src]
&mut self,
path: P
) -> Result<Texture, ImageError>
Load texture from path.
pub fn vertex_shader(
&mut self,
vertex_shader_src: &str
) -> Result<VertexShader, String>
[src]
&mut self,
vertex_shader_src: &str
) -> Result<VertexShader, String>
Create vertex shader from source.
pub fn fragment_shader(
&mut self,
fragment_shader_src: &str
) -> Result<FragmentShader, String>
[src]
&mut self,
fragment_shader_src: &str
) -> Result<FragmentShader, String>
Create fragment shader from source.
pub fn program_from_vertex_fragment(
&mut self,
vertex_shader: VertexShader,
fragment_shader: FragmentShader
) -> Program
[src]
&mut self,
vertex_shader: VertexShader,
fragment_shader: FragmentShader
) -> Program
Create program from vertex and fragment shader.
pub fn matrix4_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Matrix4Uniform, String>
[src]
&mut self,
program: Program,
name: &str
) -> Result<Matrix4Uniform, String>
Create 4D matrix uniform.
pub fn vector2_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Vector2Uniform, String>
[src]
&mut self,
program: Program,
name: &str
) -> Result<Vector2Uniform, String>
Create 2D vector uniform.
pub fn vector3_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Vector3Uniform, String>
[src]
&mut self,
program: Program,
name: &str
) -> Result<Vector3Uniform, String>
Create 3D vector uniform.
pub fn f32_uniform(
&mut self,
program: Program,
name: &str
) -> Result<F32Uniform, String>
[src]
&mut self,
program: Program,
name: &str
) -> Result<F32Uniform, String>
Create f32 uniform.
pub fn vertex_array(&mut self) -> VertexArray
[src]
Create vertex array.
pub fn uv_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> UVBuffer
[src]
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> UVBuffer
Create uv buffer.
pub fn color_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> ColorBuffer
[src]
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> ColorBuffer
Create color buffer.
pub fn vertex_buffer2(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer2
[src]
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer2
Create vertex buffer for 2D coordinates.
pub fn vertex_buffer3(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer3
[src]
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer3
Create vertex buffer for 3D coordinates.
pub fn normal_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> NormalBuffer
[src]
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> NormalBuffer
Create normal buffer.
pub fn use_program(&self, program: Program)
[src]
Use program.
pub fn set_model_view_projection(&self, matrix_id: Matrix4Uniform)
[src]
Set model-view-projection transform uniform.
pub fn set_view(&self, matrix_id: Matrix4Uniform)
[src]
Set view transform uniform.
pub fn set_model(&self, matrix_id: Matrix4Uniform)
[src]
Set model transform uniform.
pub fn set_matrix4(&self, matrix_id: Matrix4Uniform, val: Matrix4<f32>)
[src]
Set matrix uniform.
pub fn set_vector2(&self, v_id: Vector2Uniform, v: Vector2<f32>)
[src]
Set 2D vector uniform.
pub fn set_vector3(&self, v_id: Vector3Uniform, v: Vector3<f32>)
[src]
Set 3D vector uniform.
pub fn set_f32(&self, f_id: F32Uniform, v: f32)
[src]
Set f32 uniform.
pub fn set_texture(&self, texture_id: Texture)
[src]
Set texture.
pub fn translate(&mut self, v: Vector3<f32>)
[src]
Translate model.
pub fn translate_global(&mut self, v: Vector3<f32>)
[src]
Translate model in global coordinates.
pub fn scale(&mut self, v: Vector3<f32>)
[src]
Scale model.
pub fn rotate_x_deg(&mut self, deg: f32)
[src]
Rotate model around x axis with degrees.
pub fn rotate_y_deg(&mut self, deg: f32)
[src]
Rotate model around y axis with degrees.
pub fn rotate_z_deg(&mut self, deg: f32)
[src]
Rotate model around z axis with degrees.
pub fn rotate_axis_deg(&mut self, axis: Vector3<f32>, deg: f32)
[src]
Rotate model around axis with degrees.
pub fn push_transform(&mut self)
[src]
Push model transfrom to transform stack.
pub fn pop_transform(&mut self)
[src]
Pop model transform from transform stack.
pub fn clear(&self, bg_color: [f32; 4])
[src]
Clear background with color.
pub fn enable_framebuffer_srgb(&self)
[src]
Enable framebuffer sRGB.
pub fn disable_framebuffer_srgb(&self)
[src]
Disable framebuffer sRGB.
pub fn enable_blend(&self)
[src]
Enable blend.
pub fn disable_blend(&self)
[src]
Disable blend.
pub fn enable_cull_face(&self)
[src]
Enable cull face.
pub fn disable_cull_face(&self)
[src]
Disable cull face.
pub fn cull_face_front(&self)
[src]
Cull front face.
pub fn cull_face_back(&self)
[src]
Cull back face.
pub fn cull_face_front_and_back(&self)
[src]
Cull both front and back face.
pub fn draw_triangles(&self, vertex_array: VertexArray, len: usize)
[src]
Draws triangles.
pub fn draw_triangle_strip(&self, vertex_array: VertexArray, len: usize)
[src]
Draws triangle strip.
pub fn draw_points(&self, vertex_array: VertexArray, len: usize)
[src]
Draws points.
pub fn draw_lines(&self, vertex_array: VertexArray, len: usize)
[src]
Draws lines.
pub fn submit(&mut self, commands: &[Command], frame_graph: &FrameGraph)
[src]
Executes commands in command list.
pub fn draw(&mut self, command_list: CommandList, frame_graph: &FrameGraph)
[src]
Draws a command list from frame graph.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnwindSafe for Scene
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,