[][src]Struct turbine_scene3d::Scene

pub struct Scene {
    pub settings: SceneSettings,
    pub projection: Matrix4<f32>,
    pub camera: Matrix4<f32>,
    pub model: Matrix4<f32>,
    // some fields omitted
}

Stores scene data.

Fields

settings: SceneSettings

Scene settings.

projection: Matrix4<f32>

Projection transform.

camera: Matrix4<f32>

Camera transform.

model: Matrix4<f32>

Model transform.

Methods

impl Scene[src]

pub fn new(settings: SceneSettings) -> Scene[src]

Create new scene.

pub fn load_texture<P: AsRef<Path>>(
    &mut self,
    path: P
) -> Result<Texture, ImageError>
[src]

Load texture from path.

pub fn vertex_shader(
    &mut self,
    vertex_shader_src: &str
) -> Result<VertexShader, String>
[src]

Create vertex shader from source.

pub fn fragment_shader(
    &mut self,
    fragment_shader_src: &str
) -> Result<FragmentShader, String>
[src]

Create fragment shader from source.

pub fn program_from_vertex_fragment(
    &mut self,
    vertex_shader: VertexShader,
    fragment_shader: FragmentShader
) -> Program
[src]

Create program from vertex and fragment shader.

pub fn matrix4_uniform(
    &mut self,
    program: Program,
    name: &str
) -> Result<Matrix4Uniform, String>
[src]

Create 4D matrix uniform.

pub fn vector2_uniform(
    &mut self,
    program: Program,
    name: &str
) -> Result<Vector2Uniform, String>
[src]

Create 2D vector uniform.

pub fn vector3_uniform(
    &mut self,
    program: Program,
    name: &str
) -> Result<Vector3Uniform, String>
[src]

Create 3D vector uniform.

pub fn f32_uniform(
    &mut self,
    program: Program,
    name: &str
) -> Result<F32Uniform, String>
[src]

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]

Create uv buffer.

pub fn color_buffer(
    &mut self,
    vertex_array: VertexArray,
    attribute: u32,
    data: &[f32]
) -> ColorBuffer
[src]

Create color buffer.

pub fn vertex_buffer2(
    &mut self,
    vertex_array: VertexArray,
    attribute: u32,
    data: &[f32]
) -> VertexBuffer2
[src]

Create vertex buffer for 2D coordinates.

pub fn vertex_buffer3(
    &mut self,
    vertex_array: VertexArray,
    attribute: u32,
    data: &[f32]
) -> VertexBuffer3
[src]

Create vertex buffer for 3D coordinates.

pub fn normal_buffer(
    &mut self,
    vertex_array: VertexArray,
    attribute: u32,
    data: &[f32]
) -> NormalBuffer
[src]

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

impl Drop for Scene[src]

Auto Trait Implementations

impl Send for Scene

impl Sync for Scene

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.