예제 #1
0
        public Clump(SectionHeader header, Stream stream)
            : base(header, stream)
        {
            var data = ReadSection<Data>(); // Struct
            if (data == null) return;

            var reader = new BinaryReader(new MemoryStream(data.Value));

            AtomicCount = reader.ReadUInt32();
            LightCount = reader.ReadUInt32();
            CameraCount = reader.ReadUInt32();

            FrameList = ReadSection<FrameList>(); // Frame List
            GeometryList = ReadSection<GeometryList>(); // Geometry List

            Atomics = new Atomic[AtomicCount];

            for (int i = 0; i < AtomicCount; ++i)
            {
                Atomics[i] = ReadSection<Atomic>(); // Atomic
            }

            var section = ReadSection<SectionData>();
            var extension = section as Extension;

            if (extension != null) {
                var collision = extension.FirstOrDefault<CollisionModel>();
                if (collision != null) {
                    Collision = collision.Collision;
                }
            }
        }
예제 #2
0
파일: Clump.cs 프로젝트: CyberSys/UTA
        public Clump(SectionHeader header, Stream stream)
            : base(header, stream)
        {
            var data = ReadSection <Data>(); // Struct

            if (data == null)
            {
                return;
            }

            var reader = new BinaryReader(new MemoryStream(data.Value));

            AtomicCount = reader.ReadUInt32();
            LightCount  = reader.ReadUInt32();
            CameraCount = reader.ReadUInt32();

            FrameList    = ReadSection <FrameList>();    // Frame List
            GeometryList = ReadSection <GeometryList>(); // Geometry List

            Atomics = new Atomic[AtomicCount];

            for (int i = 0; i < AtomicCount; ++i)
            {
                Atomics[i] = ReadSection <Atomic>(); // Atomic
            }

            var section   = ReadSection <SectionData>();
            var extension = section as Extension;

            if (extension != null)
            {
                var collision = extension.FirstOrDefault <CollisionModel>();
                if (collision != null)
                {
                    Collision = collision.Collision;
                }
            }
        }