Exemple #1
0
        public Setup(uint setupID)
        {
            // make simple setup if gfxobj
            if (setupID >> 24 == 0x1)
            {
                MakeSimpleSetup(setupID);
                BuildBoundingBox();
                return;
            }

            _setup = DatManager.PortalDat.ReadFromDat <SetupModel>(setupID);

            Parts = new List <GfxObj>();

            foreach (var part in _setup.Parts)
            {
                Parts.Add(GfxObjCache.Get(part));
            }

            PlacementFrames = new List <Matrix>();

            if (!_setup.PlacementFrames.TryGetValue((int)Placement.Resting, out var placementFrames))
            {
                _setup.PlacementFrames.TryGetValue((int)Placement.Default, out placementFrames);
            }

            foreach (var placementFrame in placementFrames.AnimFrame.Frames)
            {
                PlacementFrames.Add(placementFrame.ToXna());
            }

            BuildBoundingBox();
        }
Exemple #2
0
        public GfxObjInstance(uint gfxObjID)
        {
            GfxObj = GfxObjCache.Get(gfxObjID);

            Position = Vector3.Zero;
            Rotation = Quaternion.Identity;
            Scale    = Vector3.One;
        }
Exemple #3
0
        public void MakeSimpleSetup(uint gfxObjID)
        {
            _setup = SetupModel.CreateSimpleSetup();

            Parts = new List <GfxObj>(1);

            var gfxObj = GfxObjCache.Get(gfxObjID);

            Parts.Add(gfxObj);

            // always identity?
            PlacementFrames = new List <Matrix>(1);
            PlacementFrames.Add(Matrix.Identity);
        }