Esempio n. 1
0
        public static GsVector ComputeProjectileDirection(float angle)
        {
            GsVector v         = new GsVector(1, 0);
            GsMatrix rotMatrix = GsMatrix.CreateRotationZ(angle);

            return(GsVector.Transform(v, rotMatrix));
        }
Esempio n. 2
0
        /// <summary></summary>
        protected virtual GsMatrix CreateTransform(ImageParams data)
        {
            // create the matrix for transforming the center
            GsMatrix transform =
                GsMatrix.CreateTranslation(-data.Origin.X, -data.Origin.Y, 0) *
                GsMatrix.CreateRotationZ(Orientation) *
                GsMatrix.CreateScale(data.Scale.X, data.Scale.Y, 1f) *
                GsMatrix.CreateTranslation(data.Position.X, data.Position.Y, 0);

            // return the transform
            return(transform);
        }