Exemplo n.º 1
0
        static BoundComposite GenCol_CreateBoundComposite(ModelData data)
        {
            var bComposite = new BoundComposite()
            {
                BoundingBoxCenter    = (RAGE_Vector3)data.BsCenter,
                BoundingSphereRadius = data.BsRadius,
                BoundingBoxMin       = (RAGE_Vector3)data.BbMin,
                BoundingBoxMax       = (RAGE_Vector3)data.BbMax,
                CenterGravity        = new RAGE_Vector3(0.0f, 0.0f, 0.0f),
                Margin      = 0.04f,
                Type        = 10,
                Children    = new ResourcePointerArray64 <Bound>(),
                ChildFlags1 = new ResourceSimpleArray <ulong_r>()
                {
                    new ulong_r {
                        Value = 0
                    }
                },
                ChildFlags2 = new ResourceSimpleArray <ulong_r>()
                {
                    new ulong_r {
                        Value = 0
                    }
                }
            };

            var mat    = Matrix5x4.Identity;
            var matrix = new RAGE_Matrix4();

            matrix.m11 = mat.M11;
            matrix.m12 = mat.M12;
            matrix.m13 = mat.M13;
            matrix.m14 = mat.M14;
            matrix.m21 = mat.M21;
            matrix.m21 = mat.M21;
            matrix.m22 = mat.M22;
            matrix.m23 = mat.M23;
            matrix.m24 = mat.M24;
            matrix.m31 = mat.M31;
            matrix.m32 = mat.M32;
            matrix.m33 = mat.M33;
            matrix.m34 = mat.M34;
            matrix.m41 = mat.M41;
            matrix.m42 = mat.M42;
            matrix.m43 = mat.M43;
            matrix.m44 = mat.M44;

            bComposite.ChildTransformations1 = new ResourceSimpleArray <RAGE_Matrix4> {
                matrix
            };
            bComposite.ChildTransformations2 = new ResourceSimpleArray <RAGE_Matrix4> {
                matrix
            };

            return(bComposite);
        }
Exemplo n.º 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.Unknown_A8h         = reader.ReadUInt32();
            this.Unknown_ACh         = reader.ReadUInt32();
            this.Unknown_B0h         = reader.ReadBlock <RAGE_Matrix4>();
            this.BoundPointer        = reader.ReadUInt64();
            this.Unknown_F8h_Pointer = reader.ReadUInt64();
            this.Count1               = reader.ReadUInt16();
            this.Count2               = reader.ReadUInt16();
            this.Unknown_104h         = reader.ReadUInt32();
            this.Unknown_108h_Pointer = reader.ReadUInt64();
            this.Count3               = reader.ReadUInt16();
            this.Count4               = reader.ReadUInt16();
            this.Unknown_114h         = reader.ReadUInt32();
            this.Unknown_118h         = reader.ReadUInt32();
            this.Unknown_11Ch         = reader.ReadUInt32();
            this.Unknown_120h         = reader.ReadUInt32();
            this.Unknown_124h         = reader.ReadUInt32();
            this.Unknown_128h         = reader.ReadUInt32();
            this.Unknown_12Ch         = reader.ReadUInt32();
            this.NamePointer          = reader.ReadUInt64();
            this.Unknown_138h         = reader.ReadUInt32();
            this.Unknown_13Ch         = reader.ReadUInt32();
            this.Unknown_140h         = reader.ReadUInt32();
            this.Unknown_144h         = reader.ReadUInt32();
            this.Unknown_148h         = reader.ReadUInt32();
            this.Unknown_14Ch         = reader.ReadUInt32();

            // read reference data
            this.Bound = reader.ReadBlockAt <Bound>(
                this.BoundPointer // offset
                );
            this.Unknown_F8h_Data = reader.ReadBlockAt <ResourceSimpleArray <ulong_r> >(
                this.Unknown_F8h_Pointer, // offset
                this.Count1
                );
            this.Unknown_108h_Data = reader.ReadBlockAt <ResourceSimpleArray <RAGE_Matrix4> >(
                this.Unknown_108h_Pointer, // offset
                this.Count2
                );
            this.Name = reader.ReadBlockAt <string_r>(
                this.NamePointer // offset
                );
        }