예제 #1
0
파일: Setup.cs 프로젝트: darelc/ACViewer
        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();
        }
예제 #2
0
        public GfxObjInstance(uint gfxObjID)
        {
            GfxObj = GfxObjCache.Get(gfxObjID);

            Position = Vector3.Zero;
            Rotation = Quaternion.Identity;
            Scale    = Vector3.One;
        }
예제 #3
0
파일: Setup.cs 프로젝트: OptimShi/ACViewer
        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);
        }