use rusting_engine::{
CollisionType, ComputeShaderType, Engine, Material, Physics, ShaderType, Transform,
};
pub fn main() {
let mut engine = Engine::new("RustingEngine - Rotation test");
engine.set_light([30.0, 50.0, 30.0], [1.0, 1.0, 1.0], 500.0);
engine.add_cube(
Transform {
position: [0.5, 20.0, 0.0],
scale: [1.0, 1.0, 1.0],
..Default::default()
},
&Material::standard()
.color([0.5, 0.5, 1.0])
.shader(ShaderType::Pbr)
.build(),
&Physics::default().collision_type(CollisionType::Box),
);
engine.add_sphere(
Transform {
position: [0.0, 10.0, 0.0],
scale: [1.0, 1.0, 1.0],
..Default::default()
},
&Material::standard()
.color([1.0, 0.1, 0.1])
.shader(ShaderType::Pbr)
.build(),
&Physics::default()
.compute_shader(ComputeShaderType::FullPhysics)
.collision_type(CollisionType::Sphere),
2,
);
engine.add_cube(
Transform {
position: [0.0, 4.0, 0.0],
scale: [40.0, 1.0, 40.0],
..Default::default()
},
&Material::standard()
.color([0.5, 0.5, 0.5])
.shader(ShaderType::Unlit)
.build(),
&Physics::default()
.mass(1000000.0)
.collision_type(CollisionType::Box),
);
engine.run();
}