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; }
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); }
public BoxModel(BoxModelDef def) { _def = def; //hold on to the _def until Initialize is called }