Exemplo n.º 1
0
        public virtual void OnRender(ModelEntityShader shader)
        {
            if (_transformInvalid || _lastPos != Position) {
                _transform =
                    Matrix4.Mult(
                        Matrix4.Mult(
                            Matrix4.Mult(
                                Matrix4.CreateTranslation(_offset),
                                Matrix4.CreateScale(_scale)),
                        Matrix4.CreateFromQuaternion(Rotation)),
                    Matrix4.CreateTranslation(Entity.Position));

                _transformInvalid = false;
                _lastPos = Position;
            }

            if (Model != null) {
                shader.Render(Model, Skin, _transform);
            }
        }