Exemple #1
0
        public void PushBall()
        {
            int         rotation = _gameManager.CurrentLevel.Random.Next(0, 6);
            TV_2DVECTOR impulse  = new TV_2DVECTOR(50f, 50f);

            impulse = RotateVector(impulse, rotation);

            _gameManager.TvPhysics.AddImpulse(_physicsBody, new TV_3DVECTOR(impulse.x, 0, impulse.y));
        }
Exemple #2
0
        public TV_2DVECTOR RotateVector(TV_2DVECTOR vector, float radians)
        {
            TV_2DVECTOR outVector = new TV_2DVECTOR
            {
                x = vector.x * (float)System.Math.Cos(radians) - vector.y * (float)System.Math.Sin(radians),
                y = vector.y * (float)System.Math.Cos(radians) + vector.x * (float)System.Math.Sin(radians)
            };

            return(outVector);
        }
Exemple #3
0
 public static Vector2 ToVector2(this TV_2DVECTOR vector)
 {
     return(new Vector2(vector.x, vector.y));
 }