Struct three::Factory
[−]
[src]
pub struct Factory { /* fields omitted */ }
Factory
is used to instantiate game objects.
Methods
impl Factory
[src]
fn scene(&mut self) -> Scene
Create new empty Scene
.
fn orthographic_camera<P>(
&mut self,
center: P,
extent_y: f32,
near: f32,
far: f32
) -> Camera<Orthographic> where
P: Into<Point2<f32>>,
&mut self,
center: P,
extent_y: f32,
near: f32,
far: f32
) -> Camera<Orthographic> where
P: Into<Point2<f32>>,
Create new Orthographic Camera. It's used basically to render 2D.
fn perspective_camera(
&mut self,
fov_y: f32,
near: f32,
far: f32
) -> Camera<Perspective>
&mut self,
fov_y: f32,
near: f32,
far: f32
) -> Camera<Perspective>
Create new Perspective Camera. It's used basically to render 3D.
fn group(&mut self) -> Group
Create empty Group
.
fn mesh(&mut self, geometry: Geometry, mat: Material) -> Mesh
Create new Mesh
with desired Geometry
and Material
.
fn mesh_dynamic(&mut self, geometry: Geometry, mat: Material) -> DynamicMesh
Create a new DynamicMesh
with desired Geometry
and Material
.
fn mesh_instance(&mut self, template: &Mesh, mat: Material) -> Mesh
Create a Mesh
sharing the geometry with another one.
Rendering a sequence of meshes with the same geometry is faster.
fn sprite(&mut self, mat: Material) -> Sprite
Create new sprite from Material
.
fn ambient_light(&mut self, color: Color, intensity: f32) -> AmbientLight
Create new AmbientLight
.
fn directional_light(
&mut self,
color: Color,
intensity: f32
) -> DirectionalLight
&mut self,
color: Color,
intensity: f32
) -> DirectionalLight
Create new DirectionalLight
.
fn hemisphere_light(
&mut self,
sky_color: Color,
ground_color: Color,
intensity: f32
) -> HemisphereLight
&mut self,
sky_color: Color,
ground_color: Color,
intensity: f32
) -> HemisphereLight
Create new HemisphereLight
.
fn point_light(&mut self, color: Color, intensity: f32) -> PointLight
Create new PointLight
.
fn shadow_map(&mut self, width: u16, height: u16) -> ShadowMap
Create new ShadowMap
.
impl Factory
[src]
fn load_texture(&mut self, path_str: &str) -> Texture<[f32; 4]>
Load texture from file. Supported file formats are: PNG, JPEG, GIF, WEBP, PPM, TIFF, TGA, BMP, ICO, HDR.
fn load_obj(&mut self, path_str: &str) -> (HashMap<String, Group>, Vec<Mesh>)
fn mix(&mut self, mesh: &DynamicMesh, shapes: &[(&str, f32)])
Update the geometry of DynamicMesh
.