public static void ForEachTemporalList(DataForDraw_angled Data, List <CubicalMemory.Cube> Temper, float cx, float cy, float cz, bool ShowAlways = false)
        {
            float x = 0, y = 0, z = 0;

            //Так по поводу взрыва. Давай все мерить в TNT эквиваленте.
            float Me = (float)Projectile.settings.Me; //mass of the fragmenting casing
            float Mc = (float)Projectile.settings.Mc; //mass of the explosive charge
            float K  = (float)Projectile.settings.K;  //Geometrical Constant for cube
            float dE = (float)Projectile.settings.dE; // J/kg Heat of TNT Explosion

            double rightpart = (Mc / Me) / (1 + K * (Mc / Me));

            float V = (float)Math.Sqrt(2 * dE * (rightpart));

            ExplosionVelocity = V;
            foreach (var cube in Temper)
            {
                ShaderedScene.CalculateFromMaptoGraphical(cube, ref x, ref y, ref z);

                float Vx = x - cx, Vy = y - cy, Vz = z - cz;
                float Range = (float)Math.Sqrt((double)Vx * Vx + Vy * Vy + Vz * Vz);
                Vx *= V / (Range * Range); Vy *= V / (Range * Range); Vz *= V / (Range * Range);
                float Velocity = (float)Math.Sqrt((double)Vx * Vx + Vy * Vy + Vz * Vz);

                if (ShowAlways || Velocity > 10)
                {
                    cube.IsTakenForExplosion = true;
                    Data.Draw_Quad_Full_Sunsided_angled(x, y, z, Vx, Vy, Vz, localed_range, cube.color, 0, true);
                }
            }
        }
Example #2
0
 public ShaderedScene(OpenGL gl)
 {
     Main              = new DataForDraw_Main(gl);
     Ghost             = new DataForDraw_Ghost(gl);
     FreshlyPlacedList = new DataForDraw_FreshlyPlacedCubes(gl);
     ExplosionList     = new DataForDraw_ExplodingList(gl);
     SunAndMoon        = new DataForDraw_SunAndMoon(gl);
     ProjectileList    = new DataForDraw_Projectile(gl);
     TrajectoryPath    = new DataForDraw_TrajectoryPath(gl);
 }
Example #3
0
 public SceneInfo_Secondary(OpenGL _gl, DataForDraw_angled _Data) : base(_gl)
 {
     Data = _Data;
 }