コード例 #1
0
   public void mousebuttonteste(MouseState ms)
   {
       ///Create an object
       IObject physObj = SpawnPrimitive(_mundo.CameraManager.ActiveCamera.Position, Matrix.CreateRotationX(0.5f));
       physObj.PhysicObject.Velocity = (_mundo.CameraManager.ActiveCamera.Target - _mundo.CameraManager.ActiveCamera.Position) * 15.0f;
       
       ///Create a light that follow an object
       MoveablePointLight mvp = new MoveablePointLight(physObj.PhysicObject as SphereObject, new Color((float)rd.NextDouble(),(float) rd.NextDouble(),(float) rd.NextDouble()),25, 5);
       mvp.UsePointLightQuadraticAttenuation = true;                        
       ///Add them to the world
       _mundo.AddLight(mvp);
       physObj.Name = "FlyingBall " + ++i;
       _mundo.AddObject(physObj);
 
   }
コード例 #2
0
        public void mousebuttonteste(MouseState ms)
        {
            ///Create an object
            IObject physObj = SpawnPrimitive(_mundo.CameraManager.ActiveCamera.Position, Matrix.CreateRotationX(0.5f));

            physObj.PhysicObject.Velocity = (_mundo.CameraManager.ActiveCamera.Target - _mundo.CameraManager.ActiveCamera.Position) * 15.0f;

            ///Create a light that follow an object
            MoveablePointLight mvp = new MoveablePointLight(physObj.PhysicObject as SphereObject, new Color((float)rd.NextDouble(), (float)rd.NextDouble(), (float)rd.NextDouble()), 25, 5);

            mvp.UsePointLightQuadraticAttenuation = true;
            ///Add them to the world
            _mundo.AddLight(mvp);
            physObj.Name = "FlyingBall " + ++i;
            _mundo.AddObject(physObj);
        }