コード例 #1
0
        public void AddBall(Vector3 pos)
        {
            Sim.Environment.Lighting lighting = sim.World.Lighting;
            if (lighting.NumberOfLights < 8)
            {
                Sim.Utility.PointLight l = lighting.Lights[lighting.NumberOfLights++];
                l.MoveTo(pos);
                LightBall newLight = new LightBall(l);

                lightModels.Add(newLight);
                targets.Add(newLight);
            }
            else
            {
                PhysicsBall newPBall = new PhysicsBall(pos, lightModels[new Random().Next(8)]);
                pballs.Add(newPBall);
                targets.Add(newPBall);
            }
        }
コード例 #2
0
        public void AddBall(Vector3 pos)
        {
            Sim.Environment.Lighting lighting = sim.World.Lighting;
            if (lighting.NumberOfLights < 8)
            {
                Sim.Utility.PointLight l = lighting.Lights[lighting.NumberOfLights++];
                l.MoveTo(pos);
                LightBall newLight = new LightBall(l);

                lightModels.Add(newLight);
                targets.Add(newLight);
            }
            else
            {
                PhysicsBall newPBall = new PhysicsBall(pos, lightModels[new Random().Next(8)]);
                pballs.Add(newPBall);
                targets.Add(newPBall);
            }

        }