当前位置: 首页>>代码示例>>Python>>正文


Python StreamWriter.f32方法代码示例

本文整理汇总了Python中s3py.io.StreamWriter.f32方法的典型用法代码示例。如果您正苦于以下问题:Python StreamWriter.f32方法的具体用法?Python StreamWriter.f32怎么用?Python StreamWriter.f32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在s3py.io.StreamWriter的用法示例。


在下文中一共展示了StreamWriter.f32方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
    def write(self, stream, rcol):
        s = StreamWriter(stream)
        len_offset = stream.tell()
        s.u32(0)
        start = stream.tell()
        s.hash(self.name)
        s.u32(rcol.get_block_index(self.material))
        s.u32(rcol.get_block_index(self.vertex_format))
        s.u32(rcol.get_block_index(self.vertex_buffer))
        s.u32(rcol.get_block_index(self.index_buffer))

        flags = self.primitive_type
        flags |= (self.flags << 8)
        s.u32(flags)
        s.u32(self.stream_offset)
        s.i32(self.start_vertex)
        s.i32(self.start_index)
        s.i32(self.min_vertex_index)
        s.i32(self.vertex_count)
        s.i32(self.primitive_count)
        self.bounds.write(stream)
        s.u32(rcol.get_block_index(self.skin_controller))
        s.i32(len(self.bone_references))
        for bone in self.bone_references: s.u32(bone)
        s.u32(rcol.get_block_index(self.scale_offsets))
        s.i32(len(self.states))
        for state in self.states: state.write_rcol(self, rcol)
        if self.parent.version > ModelLod.VERSION.DEFAULT:
            s.hash(self.parent_name)
            for i in range(3): s.f32(self.mirror_plane_normal[i])
            s.f32(self.mirror_plane_offset)
        end = stream.tell()
        stream.seek(len_offset, SEEK_SET)
        s.u32(end - start)
        stream.seek(end, SEEK_SET)
开发者ID:markmanching,项目名称:s3py,代码行数:37,代码来源:geometry.py

示例2: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write(self, stream, resource=None):
     s = StreamWriter(stream)
     s.u32(self.ID)
     s.u32(0)
     clip_stream = BytesIO()
     self.clip.write(clip_stream)
     s.u32(clip_stream.tell())
     clip_stream.seek(0, SEEK_SET)
     clip_ptr = StreamPtr.begin_write(s, True)
     ik_ptr = StreamPtr.begin_write(s, True)
     actor_ptr = StreamPtr.begin_write(s, True)
     event_ptr = StreamPtr.begin_write(s, True)
     s.u32(self.unknown1)
     s.u32(self.unknown2)
     vector_ptr = StreamPtr.begin_write(s, True)
     for i in range(16): s.u8(self.unknown3[i])
     clip_ptr.end()
     stream.write(clip_stream.read())
     s.align(char=self.PADDING_CHAR)
     if self.ik_info is not None:
         ik_ptr.end()
         self.ik_info.write(stream)
         s.align(char=self.PADDING_CHAR)
     actor_ptr.end()
     s.zs(self.actor_name)
     s.align(char=self.PADDING_CHAR)
     event_ptr.end()
     self.event_table.write(stream)
     s.align(char=self.PADDING_CHAR)
     vector_ptr.end()
     for i in range(4): s.f32(self.vector[i])
开发者ID:markmanching,项目名称:s3py,代码行数:33,代码来源:__init__.py

示例3: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
    def write(self, stream, resources=None):
        s = StreamWriter(stream)
        s.u32(self.version)
        tgi = TGIList()
        tgi.begin_write(stream)
        if self.version >= 0x00000007:
            ProductBase.write_presets(stream,self.presets,tgi)
        self.product_info.write(stream,tgi)

        s.i32(tgi.get_resource_index(self.model))
        s.i32(tgi.get_resource_index(self.diagonal_model))
        s.i32(tgi.get_resource_index(self.post_model))
        s.i32(self.post_tile_spacing)
        s.i8(1 if self.can_walk_over else 0)

        if self.version >= 0x00000008:
            if self.version >= 0x0000000A:
                s.i8(1 if self.should_not_get_thick_snow else 0)
                s.i8(1 if self.snow_post_shape_is_circle else 0)
                s.f32(self.snow_thickness_post_scale_factor)
                s.f32(self.snow_thickness_rail_scale_factor)
                s.f32(self.snow_thickness_post_vertical_offset)
                s.f32(self.snow_thickness_rail_vertical_offset)
                s.i8(1 if self.has_wall else 0)
            if self.version < 0x0000000A or self.has_wall:
                s.i8(1 if self.raise_fence_geometry_above_wall else 0)
                s.i32(tgi.get_resource_index(self.wall))
        tgi.end_write(stream)
开发者ID:markmanching,项目名称:s3py,代码行数:30,代码来源:catalog.py

示例4: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
    def write_rcol(self, stream, rcol):
        s = StreamWriter(stream)

        def write_names(slots):
            for slot in slots: s.hash(slot.name)

        def write_bones(slots):
            for slot in slots: s.hash(slot.bone_name)

        def write_transforms(slots):
            for slot in slots:
                s.m43(slot.transform)

        def write_offsets(slots):
            if any(slots):
                s.i32(len(list(filter(lambda slot: slot.offset != None, slots))))
                for i, slot in enumerate(slots):
                    if slot.offset != None:
                        s.i32(i)
                        for i in range(3): s.i32(slot.offset.position)
                        for i in range(3): s.i32(slot.offset.rotation)

        self.write_tag(stream)
        s.u32(self.version)
        s.i32(len(self.routing_slots))
        s.i32(len(self.container_slots))
        s.i32(len(self.effect_slots))
        s.i32(len(self.target_slots))
        s.i32(len(self.cone_slots))

        write_names(self.routing_slots)
        write_bones(self.routing_slots)
        write_transforms(self.routing_slots)
        write_offsets(self.routing_slots)

        write_names(self.container_slots)
        write_bones(self.container_slots)
        for slot in self.container_slots:
            s.u32(slot.flags)
        write_transforms(self.container_slots)
        write_offsets(self.container_slots)

        write_names(self.effect_slots)
        write_bones(self.effect_slots)
        write_transforms(self.effect_slots)
        write_offsets(self.effect_slots)

        write_names(self.target_slots)
        write_bones(self.target_slots)
        write_transforms(self.target_slots)
        write_offsets(self.target_slots)

        write_names(self.cone_slots)
        write_bones(self.cone_slots)
        write_transforms(self.cone_slots)
        for slot in self.cone_slots:
            s.f32(slot.radius)
            s.f32(slot.angle)
        write_offsets(self.cone_slots)
开发者ID:markmanching,项目名称:s3py,代码行数:61,代码来源:__init__.py

示例5: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write(self, stream, resource=None):
     Light.write(self, stream)
     s = StreamWriter(stream)
     for i in range(3): s.f32(self.at[i])
     s.f32(self.falloff_angle)
     s.f32(self.shade_light_rig_multiplier)
     s.f32(self.bottom_angle)
     for i in range(3): s.f32(self.shade_colour[i])
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:lights.py

示例6: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write_rcol(self, stream, rcol):
     s = StreamWriter(stream)
     self.write_tag(stream)
     s.u32(self.version)
     s.f32(self.framerate)
     cFrames = len(self.frames)
     s.i32(cFrames)
     data_pos = stream.tell() + (cFrames * 4)
     for frame in self.frames:
         s.u32(data_pos)
         data_pos += len(frame)
     for frame in self.frames:
         stream.write(frame)
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:material.py

示例7: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write_rcol(self, stream, rcol):
     s = StreamWriter(stream)
     self.write_tag(stream)
     s.u32(self.version)
     s.i32(len(self.lods))
     self.bounds.write(stream)
     if self.version >= self.VERSION.EXTENDED:
         s.i32(len(self.extra_bounds))
         for extra in self.extra_bounds:
             extra.write(stream)
         s.u32(self.fade_type)
         s.f32(self.custom_fade_distance)
     for lod in self.lods:
         lod.write_rcol(stream, rcol)
开发者ID:markmanching,项目名称:s3py,代码行数:16,代码来源:geometry.py

示例8: write_data

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write_data(self, stream, keys):
     s = StreamWriter(stream)
     self.pointer.end()
     if self.type_code == self.TYPE.FLOAT:
         if self.size32 == 1:
             s.f32(self.value)
         else:
             for f in self.value: s.f32(f)
     elif self.type_code == self.TYPE.INT:
         if self.size32 == 1:
             s.i32(self.value)
         else:
             for i in self.value: s.i32(i)
     elif self.type_code == self.TYPE.TEXTURE:
         if not keys == None:
             s.u32(keys.get_resource_index(self.value))
             s.u32(0)
             s.u32(0)
             s.u32(0)
         else:
             s.tgi(self.value, 'ITG')
             s.u32(0)
开发者ID:markmanching,项目名称:s3py,代码行数:24,代码来源:material.py

示例9: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write_rcol(self, stream, rcol):
     s = StreamWriter(stream)
     s.u32(self.flags)
     s.u32(self.priority)
     s.u32(0)
     s.f32(self.blend_in_time)
     s.f32(self.blend_out_time)
     s.u32(0)
     s.f32(self.speed)
     s.u32(rcol.get_block_index(self.actor, ActorDefinition))
     s.u32(self.timing_priority)
     s.u32(0x00000010)
     for i in range(5): s.u32(0)
     s.u32(DEADBEEF)
     MulticastDecisionGraphNode.write(self, stream, rcol)
开发者ID:markmanching,项目名称:s3py,代码行数:17,代码来源:jazz.py

示例10: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import f32 [as 别名]
 def write(self, stream, resource=None):
     s = StreamWriter(stream)
     s.u32(self.version_major)
     s.u32(self.version_minor)
     s.i32(len(self.bones))
     for bone in self.bones:
         for i in range(3): s.f32(bone.position[i])
         for i in range(4): s.f32(bone.orientation[i])
         for i in range(3): s.f32(bone.scale[i])
         assert bone.name != None, "Bone %s must have a name"
         s.p32(bone.name)
         s.i32(-1 if not bone.opposite in self.bones else self.bones.index(bone.opposite))
         s.i32(-1 if not bone.parent in self.bones else self.bones.index(bone.parent))
         s.u32(FNV32.hash(bone.name))
         s.u32(bone.flags)
     if self.version_major >= 4: s.p32(self.name)
     s.i32(len(self.ik_chains))
     for chain in self.ik_chains:
         chain.write(stream)
开发者ID:markmanching,项目名称:s3py,代码行数:21,代码来源:rig.py


注:本文中的s3py.io.StreamWriter.f32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。