Esempio n. 1
0
        private BoxModel InitializeBox(float x, float y, float width, float height, float density)
        {
            BoxModelDef boxModelDef = new BoxModelDef();

            boxModelDef.Width    = ConvertUnits.ToSimUnits(width);
            boxModelDef.Height   = ConvertUnits.ToSimUnits(height);
            boxModelDef.Position = ConvertUnits.ToSimUnits(x, y);
            boxModelDef.Mass     = density * boxModelDef.Width * boxModelDef.Height;

            BoxModel model = new BoxModel(boxModelDef);

            return(model);
        }
Esempio n. 2
0
 public BoxModel(BoxModelDef def)
 {
     _def = def; //hold on to the _def until Initialize is called
 }