public void Apply(ITessellator tessellator) { var position = tessellator.Transform(Vector2.Zero); tessellator.Translate(-position); tessellator.Scale(Scale.X, Scale.Y); tessellator.Rotate(Rotation, 0, 0, 1); tessellator.Translate(Translation); tessellator.Translate(position); }
private void Render(ITessellator tessellator, BlockEntity entity) { var color = tessellator.CurrentColor; tessellator.BindColor(Color.FromArgb(196, entity.IsSelected ? Color.Red : Color.White)); tessellator.PushTransform(); var origin = tessellator.Transform(Vector3.Zero); tessellator.LoadIdentity(); tessellator.Scale(entity.Size, entity.Size); tessellator.Translate(-entity.Size / 2, -entity.Size / 2); // center the rotation tessellator.Rotate(entity.Rotation, 0, 0, 1); tessellator.Translate(entity.Size, entity.Size); tessellator.Translate(origin); //tessellator.Translate(entity.Size, entity.Size); // center on the current tile position tessellator.Translate(entity.Position); // move to the entity's position BlockRegistry.Instance.GetById(entity.BlockID).Renderer.Render(tessellator); tessellator.PopTransform(); tessellator.BindColor(color); // TODO: Is this still needed? }