コード例 #1
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.BoundsPointer                   = reader.ReadUInt64();
            this.CurrentMatricesPointer          = reader.ReadUInt64();
            this.LastMatricesPointer             = reader.ReadUInt64();
            this.ChildBoundingBoxesPointer       = reader.ReadUInt64();
            this.TypeAndIncludeFlagsPointer      = reader.ReadUInt64();
            this.OwnedTypeAndIncludeFlagsPointer = reader.ReadUInt64();
            this.MaxNumBounds = reader.ReadUInt16();
            this.NumBounds    = reader.ReadUInt16();
            this.Unknown_A4h  = reader.ReadUInt32();
            this.BVHPointer   = reader.ReadUInt64();

            // read reference data
            this.Bounds = reader.ReadBlockAt <ResourcePointerArray64 <Bound> >(
                this.BoundsPointer, // offset
                this.MaxNumBounds
                );
            this.CurrentMatrices = reader.ReadBlockAt <SimpleArray <Matrix4x4> >(
                this.CurrentMatricesPointer, // offset
                this.MaxNumBounds
                );
            this.LastMatrices = reader.ReadBlockAt <SimpleArray <Matrix4x4> >(
                this.LastMatricesPointer, // offset
                this.MaxNumBounds
                );
            this.ChildBoundingBoxes = reader.ReadBlockAt <SimpleArray <Aabb> >(
                this.ChildBoundingBoxesPointer, // offset
                this.MaxNumBounds
                );
            this.TypeAndIncludeFlags = reader.ReadBlockAt <SimpleArray <ulong> >(
                this.TypeAndIncludeFlagsPointer, // offset
                this.MaxNumBounds
                );
            this.OwnedTypeAndIncludeFlags = reader.ReadBlockAt <SimpleArray <ulong> >(
                this.OwnedTypeAndIncludeFlagsPointer, // offset
                this.MaxNumBounds
                );
            this.BVH = reader.ReadBlockAt <BVH>(
                this.BVHPointer // offset
                );
        }
コード例 #2
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.ChildrenPointer = reader.ReadUInt64();
            this.ChildTransformations1Pointer = reader.ReadUInt64();
            this.ChildTransformations2Pointer = reader.ReadUInt64();
            this.ChildBoundingBoxesPointer    = reader.ReadUInt64();
            this.ChildFlags1Pointer           = reader.ReadUInt64();
            this.ChildFlags2Pointer           = reader.ReadUInt64();
            this.ChildrenCount1 = reader.ReadUInt16();
            this.ChildrenCount2 = reader.ReadUInt16();
            this.Unknown_A4h    = reader.ReadUInt32();
            this.BVHPointer     = reader.ReadUInt64();

            // read reference data
            this.Children = reader.ReadBlockAt <ResourcePointerArray64 <Bound> >(
                this.ChildrenPointer, // offset
                this.ChildrenCount1
                );
            this.ChildTransformations1 = reader.ReadBlockAt <ResourceSimpleArray <RAGE_Matrix4> >(
                this.ChildTransformations1Pointer, // offset
                this.ChildrenCount1
                );
            this.ChildTransformations2 = reader.ReadBlockAt <ResourceSimpleArray <RAGE_Matrix4> >(
                this.ChildTransformations2Pointer, // offset
                this.ChildrenCount1
                );
            this.ChildBoundingBoxes = reader.ReadBlockAt <ResourceSimpleArray <RAGE_AABB> >(
                this.ChildBoundingBoxesPointer, // offset
                this.ChildrenCount1
                );
            this.ChildFlags1 = reader.ReadBlockAt <ResourceSimpleArray <ulong_r> >(
                this.ChildFlags1Pointer, // offset
                this.ChildrenCount1
                );
            this.ChildFlags2 = reader.ReadBlockAt <ResourceSimpleArray <ulong_r> >(
                this.ChildFlags2Pointer, // offset
                this.ChildrenCount1
                );
            this.BVH = reader.ReadBlockAt <BVH>(
                this.BVHPointer // offset
                );
        }
コード例 #3
0
ファイル: BoundBVH.cs プロジェクト: xchgrbprsp/gta-toolkit
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.BvhPointer   = reader.ReadUInt64();
            this.Unknown_138h = reader.ReadUInt32();
            this.Unknown_13Ch = reader.ReadUInt32();
            this.Unknown_140h = reader.ReadUInt16();
            this.Unknown_142h = reader.ReadUInt16();
            this.Unknown_144h = reader.ReadUInt32();
            this.Unknown_148h = reader.ReadUInt32();
            this.Unknown_14Ch = reader.ReadUInt32();

            // read reference data
            this.BVH = reader.ReadBlockAt <BVH>(
                this.BvhPointer // offset
                );
        }