コード例 #1
0
ファイル: Collision.cs プロジェクト: swordworld/dstools
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                CompressedBVH  = new HKArray <CompressedMeshBVHNode>(hkx, section, this, br, variation);
                BoundingBoxMin = br.ReadVector4();
                BoundingBoxMax = br.ReadVector4();

                Unk40 = br.ReadUInt32();
                Unk44 = br.ReadUInt32();
                Unk48 = br.ReadUInt32();
                Unk4C = br.ReadUInt32();

                Chunks        = new HKArray <CollisionMeshChunk>(hkx, section, this, br, variation);
                MeshIndices   = new HKArray <MeshPrimitive>(hkx, section, this, br, variation);
                VertexIndices = new HKArray <HKUShort>(hkx, section, this, br, variation);
                SmallVertices = new HKArray <SmallCompressedVertex>(hkx, section, this, br, variation);
                LargeVertices = new HKArray <LargeCompressedVertex>(hkx, section, this, br, variation);
                UnkA0         = new HKArray <HKUInt>(hkx, section, this, br, variation);
                UnkB0         = br.ReadUInt64();
                UnkB8         = new HKArray <UnknownStructure2>(hkx, section, this, br, variation);
                UnkC8         = br.AssertUInt64(0);

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #2
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                Faces    = new HKArray <NVMFace>(hkx, section, this, br, variation);
                Edges    = new HKArray <NVMEdge>(hkx, section, this, br, variation);
                Vertices = new HKArray <HKVector4>(hkx, section, this, br, variation);
                br.ReadUInt64s(2); // hkaiStreamingSet seems unused
                FaceData         = new HKArray <HKUInt>(hkx, section, this, br, variation);
                EdgeData         = new HKArray <HKUInt>(hkx, section, this, br, variation);
                FaceDataStriding = br.ReadInt32();
                EdgeDataStriding = br.ReadInt32();
                Flags            = br.ReadByte();
                br.AssertByte(0);   // Padding
                br.AssertUInt16(0); // Padding
                AABBMin       = br.ReadVector4();
                AABBMax       = br.ReadVector4();
                ErosionRadius = br.ReadSingle();
                UserData      = br.ReadUInt64();
                br.ReadUInt64(); // Padding

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #3
0
ファイル: Collision.cs プロジェクト: swordworld/dstools
            public override void Read(HKX hkx, HKXSection section, HKXObject source, BinaryReaderEx br, HKXVariation variation)
            {
                CompressedBVH     = new HKArray <CompressedChunkBVHNode>(hkx, section, source, br, variation);
                BoundingBoxMin    = br.ReadVector4();
                BoundingBoxMax    = br.ReadVector4();
                SmallVertexOffset = br.ReadVector3();
                SmallVertexScale  = br.ReadVector3();

                SmallVerticesBase = br.ReadUInt32();

                uint vertexIndices = br.ReadUInt32();

                VertexIndicesIndex  = (int)(vertexIndices >> 8);
                VertexIndicesLength = (byte)(vertexIndices & 0xFF);

                uint unk50 = br.ReadUInt32();

                ByteIndicesIndex  = (int)(unk50 >> 8);
                ByteIndicesLength = (byte)(unk50 & 0xFF);

                uint unk54 = br.ReadUInt32();

                Unk54Index  = (int)(unk54 >> 8);
                Unk54Length = (byte)(unk54 & 0xFF);

                Unk58 = br.ReadUInt32();
                Unk5C = br.ReadUInt32();
            }
コード例 #4
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);
                AssertPointer(hkx, br);
                AssertPointer(hkx, br);
                TransformTrackToBoneIndices  = new HKArray <HKShort>(hkx, section, this, br, variation);
                FloatTrackToFloatSlotIndices = new HKArray <HKShort>(hkx, section, this, br, variation);


                if (variation != HKXVariation.HKXDS1)
                {
                    //PartitionIndices = new HKArray<HKShort>(hkx, section, this, br, variation);
                    PartitionIndices = new HKArray <HKShort>(hkx, section, this, br, variation);
                    BlendHint        = br.ReadEnum32 <AnimationBlendHint>();
                }
                else
                {
                    BlendHint            = br.ReadEnum32 <AnimationBlendHint>();
                    OriginalSkeletonName = br.ReadShiftJIS();
                    br.Pad(16);
                }

                br.Pad(16);

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #5
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                meshTree       = new HKArray <CompressedMeshBVHNode>(hkx, section, this, br, variation);
                BoundingBoxMin = br.ReadVector4();
                BoundingBoxMax = br.ReadVector4();

                numPrimitiveKeys = br.ReadUInt32();
                bitsPerKey       = br.ReadUInt32();
                maxKeyValue      = br.ReadUInt32();
                Unk4C            = br.ReadUInt32();

                sections            = new HKArray <CollisionMeshChunk>(hkx, section, this, br, variation);
                primitives          = new HKArray <MeshPrimitive>(hkx, section, this, br, variation);
                sharedVerticesIndex = new HKArray <HKUShort>(hkx, section, this, br, variation);
                packedVertices      = new HKArray <SmallCompressedVertex>(hkx, section, this, br, variation);
                sharedVertices      = new HKArray <LargeCompressedVertex>(hkx, section, this, br, variation);
                primitiveDataRuns   = new HKArray <HKUInt>(hkx, section, this, br, variation);
                UnkB0    = br.ReadUInt64();
                simdTree = new HKArray <UnknownStructure2>(hkx, section, this, br, variation);
                UnkC8    = br.AssertUInt64(0);

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #6
0
ファイル: Collision.cs プロジェクト: swordworld/dstools
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                br.AssertUInt64(0);
                br.AssertUInt64(0);
                Unk10 = br.ReadByte();
                Unk11 = br.ReadByte();
                Unk12 = br.ReadByte();
                Unk13 = br.ReadByte();
                Unk14 = br.ReadInt32();
                br.AssertUInt64(0);
                br.AssertUInt64(0);
                if (variation == HKXVariation.HKXDS3)
                {
                    br.AssertUInt64(0);
                }
                br.AssertUInt32(0xFFFFFFFF);
                br.AssertUInt32(0);

                // A seemingly empty array
                br.AssertUInt64(0);
                br.AssertUInt32(0);
                br.AssertUInt32(0x80000000);

                // A seemingly empty array
                br.AssertUInt64(0);
                br.AssertUInt32(0);
                br.AssertUInt32(0x80000000);

                br.AssertUInt32(0xFFFFFFFF);
                br.AssertUInt32(0);

                MeshShapeData = ResolveGlobalReference(hkx, section, br);

                Unk68 = new HKArray <HKUInt>(hkx, section, this, br, variation);
                Unk78 = br.ReadInt32();
                br.AssertUInt32(0);

                Unk80 = new HKArray <HKUInt>(hkx, section, this, br, variation);
                Unk90 = br.ReadInt32();
                br.AssertUInt32(0);

                br.AssertUInt64(0);

                CustomParam = ResolveGlobalReference(hkx, section, br);

                UnkA8 = new HKArray <HKUInt>(hkx, section, this, br, variation);
                if (variation == HKXVariation.HKXDS3)
                {
                    br.AssertUInt64(0);
                }

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #7
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                CompressedTree = new HKArray <StaticAABBNode>(hkx, section, this, br, variation);
                AABBMin        = br.ReadVector4();
                AABBMax        = br.ReadVector4();

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #8
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                Positions = new HKArray <HKVector4>(hkx, section, this, br, variation);
                Nodes     = new HKArray <CostGraphNode>(hkx, section, this, br, variation);
                Edges     = new HKArray <CostGraphEdge>(hkx, section, this, br, variation);
                br.ReadUInt64s(2); // unused array
                br.ReadUInt64s(2); // unused array
                br.ReadUInt64s(4); // padding

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #9
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);

                if (variation == HKXVariation.HKXBloodBorne)
                {
                    br.AssertInt32(0);
                }
                else
                {
                    AssertPointer(hkx, br);
                }

                AnimationType       = br.ReadEnum32 <AnimationType>();
                Duration            = br.ReadSingle();
                TransformTrackCount = br.ReadInt32();
                FloatTrackCount     = br.ReadInt32();

                if (variation == HKXVariation.HKXBloodBorne)
                {
                    br.Pad(16);
                }

                if (variation == HKXVariation.HKXDS1)
                {
                    br.ReadInt64s(2); // Annotations
                }
                else
                {
                    // Literally guessing here
                    br.ReadInt64s(3); // Annotations
                    //br.ReadUInt32(); // padding?
                }

                Transforms = new HKArray <Transform>(hkx, section, this, br, variation);
                Floats     = new HKArray <HKFloat>(hkx, section, this, br, variation);

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #10
0
ファイル: Collision.cs プロジェクト: swordworld/dstools
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                // vtable stuff
                AssertPointer(hkx, br);
                AssertPointer(hkx, br);
                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                Unk10 = br.ReadSingle();
                Unk14 = br.ReadSingle();
                Unk18 = br.ReadSingle();
                Unk1C = br.ReadSingle();

                MoppCode = new HKArray <HKByte>(hkx, section, this, br, variation);
                br.AssertUInt32(0);

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #11
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                //br.ReadUInt64s(1); // Name
                Name            = new HKCString(hkx, section, this, br, variation);
                ParentIndices   = new HKArray <HKShort>(hkx, section, this, br, variation);
                Bones           = new HKArray <Bone>(hkx, section, this, br, variation);
                Transforms      = new HKArray <Transform>(hkx, section, this, br, variation);
                ReferenceFloats = new HKArray <HKFloat>(hkx, section, this, br, variation);
                br.ReadUInt64s(2); // unused array
                br.ReadUInt64s(2); // unused array
                br.ReadUInt64s(2); // unused array
                br.ReadUInt64s(2); // unused array
                br.ReadUInt64s(1); // padding

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #12
0
ファイル: Collision.cs プロジェクト: swordworld/dstools
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                Bodies = new HKArray <HKNPBodyCInfo>(hkx, section, this, br, variation);
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();
                br.ReadUInt64();

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #13
0
ファイル: Collision.cs プロジェクト: swordworld/dstools
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                // By no means complete but currently quickly extracts most meshes
                SectionOffset = (uint)br.Position;

                // vtable stuff
                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                Vertices = new HKArray <HKVector4>(hkx, section, this, br, variation);
                if (variation != HKXVariation.HKSDeS)
                {
                    // Supposed to be 8-bit indices for collision, but doesn't seem to be used much if at all, so implement later
                    AssertPointer(hkx, br);
                    br.ReadUInt64();
                }
                Indices16 = new HKArray <HKUShort>(hkx, section, this, br, variation);

                // More stuff to implement (seemingly unused)

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #14
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);
                AssertPointer(hkx, br);

                if (variation != HKXVariation.HKXBloodBorne)
                {
                    AssertPointer(hkx, br);
                    AssertPointer(hkx, br);
                }

                Up.X = br.ReadSingle();
                Up.Y = br.ReadSingle();
                Up.Z = br.ReadSingle();
                Up.W = br.ReadSingle();

                Forward.X = br.ReadSingle();
                Forward.Y = br.ReadSingle();
                Forward.Z = br.ReadSingle();
                Forward.W = br.ReadSingle();

                Duration = br.ReadSingle();

                if (variation != HKXVariation.HKXDS1)
                {
                    br.AssertInt32(0); // probably padding
                }
                ReferenceFrameSamples = new HKArray <HKVector4>(hkx, section, this, br, variation);

                br.Pad(16); // probably

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }
コード例 #15
0
            public override void Read(HKX hkx, HKXSection section, BinaryReaderEx br, HKXVariation variation)
            {
                SectionOffset = (uint)br.Position;

                AssertPointer(hkx, br);

                if (variation == HKXVariation.HKXBloodBorne)
                {
                    br.AssertInt32(0);
                }
                else
                {
                    AssertPointer(hkx, br);
                }

                AnimationType       = br.ReadEnum32 <AnimationType>();
                Duration            = br.ReadSingle();
                TransformTrackCount = br.ReadInt32();
                FloatTrackCount     = br.ReadInt32();

                if (variation == HKXVariation.HKXBloodBorne)
                {
                    br.Pad(16);
                }

                if (variation == HKXVariation.HKXDS1)
                {
                    br.ReadInt64s(2); // Annotations

                    FrameCount = br.ReadInt32();
                    BlockCount = br.ReadInt32();

                    FramesPerBlock       = br.ReadInt32();
                    MaskAndQuantization  = br.ReadUInt32();
                    BlockDuration        = br.ReadSingle();
                    InverseBlockDuration = br.ReadSingle();
                    FrameDuration        = br.ReadSingle();
                }
                else
                {
                    br.ReadInt64s(3); // Annotations

                    FrameCount           = br.ReadInt32();
                    BlockCount           = br.ReadInt32();
                    FramesPerBlock       = br.ReadInt32();
                    MaskAndQuantization  = br.ReadUInt32();
                    BlockDuration        = br.ReadSingle();
                    InverseBlockDuration = br.ReadSingle();
                    FrameDuration        = br.ReadSingle();
                    br.ReadUInt32(); // padding?
                }

                BlockOffsets          = new HKArray <HKUInt>(hkx, section, this, br, variation);
                FloatBlockOffsets     = new HKArray <HKUInt>(hkx, section, this, br, variation);
                TransformBlockOffsets = new HKArray <HKUInt>(hkx, section, this, br, variation);
                FloatOffsets          = new HKArray <HKUInt>(hkx, section, this, br, variation);
                Data   = new HKArray <HKByte>(hkx, section, this, br, variation);
                Endian = br.ReadInt32();

                DataSize = (uint)br.Position - SectionOffset;
                ResolveDestinations(hkx, section);
            }