Exemple #1
0
    def read(self, filereader: BinaryFileReader):
        super().read(filereader)

        self.unknown6 = filereader.read_uint32()

        #read header
        self.name_string = SizedCString(filereader)

        #read vertices
        self.numVertexIndices = filereader.read_uint32()
        self.vertexIndices = filereader.read_vec_uint32(self.numVertexIndices)

        #read faces
        self.numFaceIndices = filereader.read_uint32()
        self.faceIndices = filereader.read_vec_uint32(self.numFaceIndices)

        #read geometryFlags
        self.geometryFlags = filereader.read_uint32()
        self.geometryFlagsEvaluated = RSEGeometryFlags.EvaluateFlags(
            self.geometryFlags)

        #read unknown8
        self.unknown_8_string = SizedCString(filereader)

        #read unknown9
        self.unknown9 = filereader.read_uint32()
Exemple #2
0
    def read(self, filereader: BinaryFileReader):
        super().read(filereader)

        self.vertexIndices: List[int] = filereader.read_vec_uint32(3)
        self.paramIndices: List[int] = filereader.read_vec_uint32(3)
        self.faceNormal: List[float] = filereader.read_vec_f(4)
        self.materialIndex: int = filereader.read_uint32()
    def read(self, filereader: BinaryFileReader):
        super().read(filereader)

        self.lightSize: int = filereader.read_uint32()
        self.id: int = filereader.read_uint32()

        #Some maps store a version string, others don't, not quite sure why. Also makes unknown6 quite unclear as to whether they are separate fields or not
        self.name_string: SizedCString = SizedCString(filereader)
        if self.name_string.string == "Version":
            self.version_string: SizedCString = self.name_string
            self.versionNumber: int = filereader.read_uint32()

            self.name_string = SizedCString(filereader)
            self.unknown6: int = filereader.read_uint32()
        else:
            self.unknown7: bytes = filereader.read_bytes(3)

        #3x3 matrix = 9 elements
        self.transformMatrix: List[float] = filereader.read_vec_f(9)

        self.position: List[float] = filereader.read_vec_f(3)
        self.color: List[int] = filereader.read_vec_uint32(3)
        self.constantAttenuation: float = filereader.read_float()
        self.linearAttenuation: float = filereader.read_float()
        self.quadraticAttenuation: float = filereader.read_float()
        #maybe?
        self.falloff: float = filereader.read_float()
        self.energy: float = filereader.read_float()
        self.type: int = filereader.read_bytes(1)[0]
    def read(self, filereader: BinaryFileReader):
        super().read(filereader)

        self.unknown1: int = filereader.read_uint32()
        self.id: int = filereader.read_uint32()

        self.name_string: SizedCString = SizedCString(filereader)
        if self.name_string.string == "Version":
            self.version_string: SizedCString = self.name_string
            self.versionNumber: int = filereader.read_uint32()
            self.name_string = SizedCString(filereader)

        self.unknown2_bytes: bytes = filereader.read_bytes(4)  #ABCD
        self.unknown3: int = filereader.read_uint32()  #U

        self.vertexCount: int = filereader.read_uint32()
        self.vertices: List[List[float]] = []  #coordinate
        for _ in range(self.vertexCount):
            self.vertices.append(filereader.read_vec_f(3))

        self.vertexParamCount: int = filereader.read_uint32()
        self.vertexParams: List[R6VertexParameterCollection] = []  #coordinate2
        for _ in range(self.vertexParamCount):
            newParams = R6VertexParameterCollection()
            newParams.read(filereader)
            self.vertexParams.append(newParams)

        self.faceCount: int = filereader.read_uint32()
        self.faces: List[R6FaceDefinition] = []  #coordinate3
        for _ in range(self.faceCount):
            newFace = R6FaceDefinition()
            newFace.read(filereader)
            self.faces.append(newFace)
        self.unknown5: int = filereader.read_uint32()
        self.unknown6: int = filereader.read_uint32()

        self.unknown_7_string: SizedCString = SizedCString(filereader)

        self.unknown8: int = filereader.read_uint32()
        self.faceIndicesCount: int = filereader.read_uint32()
        self.faceIndices: List[int] = filereader.read_vec_uint32(
            self.faceIndicesCount)

        self.unknown10: int = filereader.read_uint32()
        self.unknown_11_string: SizedCString = SizedCString(filereader)
        self.unknown12: int = filereader.read_uint32()