Exemplo n.º 1
0
        public void Renew(LightSceneGraphReceipt receipt)
        {
            int iold = receipt.ReceivedIndex;
            int inew = (int)receipt.light.Transform.Translation.X / 32;

            if (iold != inew)
            {
                receipt.ReceivedIndex = inew;
                blocks[iold].Remove(receipt.light);
                blocks[inew].Add(receipt.light);
            }
        }
Exemplo n.º 2
0
        public LightSceneGraphReceipt Add(Light l)
        {
            int i = (int)l.Transform.Translation.X / 32;

            blocks[i].Add(l);

            LightSceneGraphReceipt r = new LightSceneGraphReceipt();
            r.light = l;
            r.ReceivedIndex = i;
            r.graph = this;

            return r;
        }
Exemplo n.º 3
0
        public LightSceneGraphReceipt Add(Light l)
        {
            int i = (int)l.Transform.Translation.X / 32;

            blocks[i].Add(l);

            LightSceneGraphReceipt r = new LightSceneGraphReceipt();

            r.light         = l;
            r.ReceivedIndex = i;
            r.graph         = this;

            return(r);
        }
Exemplo n.º 4
0
 public void Remove(LightSceneGraphReceipt receipt)
 {
     blocks[receipt.ReceivedIndex].Remove(receipt.light);
 }
Exemplo n.º 5
0
 public void Renew(LightSceneGraphReceipt receipt)
 {
     int iold = receipt.ReceivedIndex;
     int inew = (int)receipt.light.Transform.Translation.X / 32;
     if (iold != inew)
     {
         receipt.ReceivedIndex = inew;
         blocks[iold].Remove(receipt.light);
         blocks[inew].Add(receipt.light);
     }
 }
Exemplo n.º 6
0
 public void Remove(LightSceneGraphReceipt receipt)
 {
     blocks[receipt.ReceivedIndex].Remove(receipt.light);
 }
Exemplo n.º 7
0
        public PlayerObject(PlayerIndex playerIndex, Color color, Vector3 pos, float initialYRot)
        {
            this.playerIndex = playerIndex;
            this.color = color;

            // initial transform
            this._position = pos;
            rotation = initialYRot;

            SetupLights();

            mesh = new SkinnedMesh();
            mesh.Model = AssetLoader.mdl_character;

            //Create a new Animation Player that will take the bone dictionaries as arguments allowing individual animation with upper and lower body
            upPlayer = new DurationBasedAnimator(mesh.SkinningData, mesh.SkinningData.AnimationClips["Take 001"],  Animation_States.upperCharacterBones);
            lowPlayer = new DurationBasedAnimator(mesh.SkinningData, mesh.SkinningData.AnimationClips["Take 001"], Animation_States.lowerCharacterBonesandRoot);
            //Load the animations from the asset loader (these are in an Animation Package)
            upPlayer.AddAnimationPackage = AssetLoader.ani_character;
            upPlayer.StartClip(moving + shooting + weapon);
            lowPlayer.AddAnimationPackage = AssetLoader.ani_character;
            lowPlayer.StartClip(moving+weapon);
            

            UpdateAnimation(0);
            UpdateMajorTransforms(0);

            Globals.gameInstance.sceneGraph.Setup(mesh);
            modelReceipt = Globals.gameInstance.sceneGraph.Add(mesh);
            light1receipt = Globals.gameInstance.sceneGraph.Add(torchlight);
            light2receipt = Globals.gameInstance.sceneGraph.Add(haloemitlight);
            light3receipt = Globals.gameInstance.sceneGraph.Add(halolight);

            SetupWeapons();
            SwitchWeapon(0);

            collisionRectangle = new RectangleF(
                _position.X - boundingBoxSize,
                _position.Y - boundingBoxSize,
                boundingBoxSize * 2,
                boundingBoxSize * 2
            );

        }