Beispiel #1
0
 protected VanillaCharacter(CharacMgr characMgr, CharacterInfo charInfo)
 {
     this.mCharacMgr         = characMgr;
     this.mCharInfo          = charInfo;
     this.MovementInfo       = new MovementInfo(this.OnFall, this.OnJump);
     this.mPreviousDirection = Vector3.ZERO;
     this.mTimeSinceDead     = 0;
     this.mLastSquaredDist   = -1;
     this.mForcedDestination = new Stack <Vector3>();
 }
        public VanillaNonPlayer(CharacMgr characMgr, string meshName, CharacterInfo info) : base(characMgr, info)
        {
            SceneManager sceneMgr = characMgr.SceneMgr;
            Entity       ent      = sceneMgr.CreateEntity("CharacterEnt_" + this.mCharInfo.Id, meshName);

            ent.Skeleton.BlendMode = SkeletonAnimationBlendMode.ANIMBLEND_CUMULATIVE;
            ent.SetMaterialName("Robot_T");
            this.mMesh = new Robot(ent);

            this.mNode = characMgr.SceneMgr.RootSceneNode.CreateChildSceneNode("CharacterNode_" + this.mCharInfo.Id, Vector3.ZERO, this.mMesh.InitialOrientation);
            this.mNode.AttachObject(ent);
            this.FinishCreation();
        }
Beispiel #3
0
        public VanillaPlayer(CharacMgr characMgr, string meshName, CharacterInfo info) : base(characMgr, info)
        {
            SceneManager sceneMgr = characMgr.SceneMgr;
            Entity       ent      = sceneMgr.CreateEntity("CharacterEnt_" + this.mCharInfo.Id, meshName);

            ent.Skeleton.BlendMode = SkeletonAnimationBlendMode.ANIMBLEND_CUMULATIVE;
            Entity swordL = sceneMgr.CreateEntity("Sword.mesh");

            ent.AttachObjectToBone("Sheath.L", swordL);
            Entity swordR = sceneMgr.CreateEntity("Sword.mesh");

            ent.AttachObjectToBone("Sheath.R", swordR);
            this.mMesh = new Sinbad(ent);

            this.mNode = characMgr.SceneMgr.RootSceneNode.CreateChildSceneNode("CharacterNode_" + this.mCharInfo.Id, Vector3.ZERO, this.mMesh.InitialOrientation);
            this.mNode.AttachObject(ent);
            this.mNode.Scale(this.mMesh.MeshSize / ent.BoundingBox.Size);
            this.mNode.Orientation = this.mMesh.InitialOrientation;

            this.mShootCube = new ShootCube(this.mCharacMgr.BulletMgr, this);
            this.FinishCreation();
        }