public MModel(MModel m) { position = new Point(m.position); dimensions = new Dimension(m.dimensions); velocity = new Velocity(m.velocity); if (target != null) { target = new Point(m.target); } }
public Drawable(Game game, int sx, int sy, MModel d) : base(game) { displayable = d; sourceX = sx; sourceY = sy; dimensions = displayable.dimensions; //section = new Rectangle(sourceX, sourceY, dimensions.width, dimensions.height); origin = new Vector2(section.Width / 2, section.Height / 2); spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch)); model = LoadTexture(); if (model != null) { transformations = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(transformations); } }
public Drawable(Drawable d, MModel m) : base(d.Game) { displayable = m; //file = d.file; sourceX = d.sourceX; sourceY = d.sourceY; dimensions = new Dimension(d.dimensions); section = new Rectangle(sourceX, sourceY, dimensions.width, dimensions.height); origin = new Vector2(section.Width / 2, section.Height / 2); spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch)); model = d.model; if (model != null) { transformations = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(transformations); } }