rust/lib-hedgewars-engine/src/world.rs
changeset 15755 2eb3469a28a0
parent 15275 66c987015f2d
child 15757 c7332c7f64cd
equal deleted inserted replaced
15754:aa011799cb63 15755:2eb3469a28a0
     1 use fpnum::{fp, FPNum, FPPoint};
     1 use fpnum::{fp, FPNum, FPPoint};
     2 use hwphysics::{
     2 use hwphysics::{
     3     self as hwp,
     3     self as hwp,
     4     common::{GearId, Millis},
     4     common::{GearId, Millis},
       
     5     physics::{PositionData, VelocityData},
     5 };
     6 };
     6 use integral_geometry::{Point, Rect, Size};
     7 use integral_geometry::{Point, Rect, Size};
     7 use land2d::Land2D;
     8 use land2d::Land2D;
     8 use landgen::{
     9 use landgen::{
     9     outline_template::OutlineTemplate, template_based::TemplatedLandGenerator,
    10     outline_template::OutlineTemplate, template_based::TemplatedLandGenerator,
   133         if let Some(ref mut state) = self.game_state {
   134         if let Some(ref mut state) = self.game_state {
   134             let id = state.physics.new_gear().unwrap();
   135             let id = state.physics.new_gear().unwrap();
   135             let fp_position = FPPoint::new(position.x.into(), position.y.into());
   136             let fp_position = FPPoint::new(position.x.into(), position.y.into());
   136             state.physics.add_gear_data(
   137             state.physics.add_gear_data(
   137                 id,
   138                 id,
   138                 hwp::physics::PhysicsData::new(fp_position, FPPoint::zero()),
   139                 &PositionData(fp_position)
       
   140             );
       
   141             state.physics.add_gear_data(
       
   142                 id,
       
   143                 &VelocityData(FPPoint::zero())
   139             )
   144             )
   140         }
   145         }
   141     }
   146     }
   142 
   147 
   143     pub fn step(&mut self) {
   148     pub fn step(&mut self) {