Пример #1
0
        public static TransformRate Add(TransformRate rate1, TransformRate rate2)
        {
            TransformRate result = new TransformRate();

            Vector3.Add(ref rate1.Velocity, ref rate2.Velocity, out result.Velocity);
            Vector3.Add(ref rate1.AngularVelocity, ref rate2.AngularVelocity, out result.AngularVelocity);
            return(result);
        }
Пример #2
0
        public void ApplyTransformRate(TransformRate rate, float dt)
        {
            //m_initialSunWindPosition += dt * rate.Velocity;
            Vector3 pos;
            Vector3.Multiply(ref rate.Velocity, dt, out pos);
            Vector3.Add(ref Position, ref pos, out Position);

            Vector3 dir = rate.AngularVelocity;
            float ang = dir.Length();

            if (ang > 0.0f)
            {
                Vector3.Divide(ref dir, ang, out dir);  // dir /= ang;
                ang *= dt;
                Matrix rot;
                Matrix.CreateFromAxisAngle(ref dir, ang, out rot);
                Matrix.Multiply(ref Orientation, ref rot, out Orientation);
            }

            //  JiggleMath.Orthonormalise(ref this.Orientation);
        }
Пример #3
0
        public void ApplyTransformRate(TransformRate rate, float dt)
        {
            //m_initialSunWindPosition += dt * rate.Velocity;
            Vector3 pos;

            Vector3.Multiply(ref rate.Velocity, dt, out pos);
            Vector3.Add(ref Position, ref pos, out Position);

            Vector3 dir = rate.AngularVelocity;
            float   ang = dir.Length();

            if (ang > 0.0f)
            {
                Vector3.Divide(ref dir, ang, out dir);  // dir /= ang;
                ang *= dt;
                Matrix rot;
                Matrix.CreateFromAxisAngle(ref dir, ang, out rot);
                Matrix.Multiply(ref Orientation, ref rot, out Orientation);
            }

            //  JiggleMath.Orthonormalise(ref this.Orientation);
        }
Пример #4
0
 public static void Add(ref TransformRate rate1, ref TransformRate rate2, out TransformRate result)
 {
     Vector3.Add(ref rate1.Velocity, ref rate2.Velocity, out result.Velocity);
     Vector3.Add(ref rate1.AngularVelocity, ref rate2.AngularVelocity, out result.AngularVelocity);
 }
Пример #5
0
 public static TransformRate Add(TransformRate rate1, TransformRate rate2)
 {
     TransformRate result = new TransformRate();
     Vector3.Add(ref rate1.Velocity, ref rate2.Velocity, out result.Velocity);
     Vector3.Add(ref rate1.AngularVelocity, ref rate2.AngularVelocity, out result.AngularVelocity);
     return result;
 }
Пример #6
0
 public static void Add(ref TransformRate rate1, ref TransformRate rate2, out TransformRate result)
 {
     Vector3.Add(ref rate1.Velocity, ref rate2.Velocity, out result.Velocity);
     Vector3.Add(ref rate1.AngularVelocity, ref rate2.AngularVelocity, out result.AngularVelocity);
 }