public PhysicsBall(Vector3 position, LightBall target) 
     : base(Models.Sphere, position)
 {
     this.target = target;
     scale = 0.8f;
     radius = Models.Sphere.Meshes[0].BoundingSphere.Radius * scale;
     name = "Physics Ball";
     info = "Behavior: Normal";
     diffuseColor = new Vector3(1, 0, 0);
     ambientColor = new Vector3(0.3f);
     specularColor = Vector3.One;
     alpha = 1.0f;
 }
Ejemplo n.º 2
0
 public PhysicsBall(Vector3 position, LightBall target)
     : base(Models.Sphere, position)
 {
     this.target   = target;
     scale         = 0.8f;
     radius        = Models.Sphere.Meshes[0].BoundingSphere.Radius * scale;
     name          = "Physics Ball";
     info          = "Behavior: Normal";
     diffuseColor  = new Vector3(1, 0, 0);
     ambientColor  = new Vector3(0.3f);
     specularColor = Vector3.One;
     alpha         = 1.0f;
 }
        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);
            }
        }
        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);
            }

        }