Documentation
¶
Overview ¶
Package meshopt decodes the data of EXT_meshopt_compression (SPEC §28.5): the vertex buffers, the index buffers and the index sequences of meshoptimizer's formats (versions 0 and 1), and its four vertex filters. It is plain Go with no OS tags.
The decoders are translated to Go and changed from src/vertexcodec.cpp, src/indexcodec.cpp and src/vertexfilter.cpp of meshoptimizer 1.3 (MIT license, third_party/meshoptimizer/LICENSE). Only the scalar paths are ported (the SIMD ones give the same bytes), every read is checked against the end of the data, and a failure is an error with a reason instead of a negative code.
Index ¶
Constants ¶
const TagMeshoptFilterInvalid = "MeshoptFilterInvalid"
TagMeshoptFilterInvalid is the tag of the error of a filter that is asked for a stride it does not have, or for data shorter than its count says. The metadata has "reason", "filter", "count" and "stride".
Flutter: no counterpart
const TagMeshoptIndexInvalid = "MeshoptIndexInvalid"
TagMeshoptIndexInvalid is the tag of the error of an index buffer or an index sequence that is malformed: a header that is not one, a version that is not known, data that is too short or too long for the count. The metadata has "reason" and "bytes".
Flutter: no counterpart
const TagMeshoptVertexInvalid = "MeshoptVertexInvalid"
TagMeshoptVertexInvalid is the tag of the error of a vertex buffer that is malformed: a header that is not one, a version that is not known, data that is too short or too long for the count and the size, a channel that is not a type. The metadata has "reason", "count", "size" and "bytes".
Flutter: no counterpart
Variables ¶
This section is empty.
Functions ¶
func DecodeFilter ¶
DecodeFilter applies the filter to count elements of stride bytes each in data, in place. It fails with TagMeshoptFilterInvalid when the stride is not one that the filter has.
Flutter: no counterpart
func DecodeIndexBuffer ¶
DecodeIndexBuffer decodes the triangle index buffer in data into indices, whose length is the number of indices (a multiple of three). It fails with TagMeshoptIndexInvalid when the data is not a version 0 or 1 index buffer of exactly that many indices.
Flutter: no counterpart
func DecodeIndexSequence ¶
DecodeIndexSequence decodes the index sequence in data (the indices of points or lines, or of any list that is not a mesh) into indices. It fails with TagMeshoptIndexInvalid when the data is not a version 0 or 1 index sequence of exactly that many indices.
Flutter: no counterpart
func DecodeVertexBuffer ¶
DecodeVertexBuffer decodes count vertices of size bytes each (a multiple of four, at most 256) from data into dst, which has count*size bytes. It fails with TagMeshoptVertexInvalid when the data is not a version 0 or 1 vertex buffer of exactly that many vertices.
Flutter: no counterpart
Types ¶
type Filter ¶
type Filter int
Filter is a vertex filter of EXT_meshopt_compression: what is done to the decoded vertices to get their attributes.
Flutter: no counterpart
const ( FilterNone Filter = iota // FilterOctahedral is for normals and tangents of 4 bytes (8 bit components) or 8 bytes (16 bit components). FilterOctahedral // FilterQuaternion is for rotations of 8 bytes (16 bit components). FilterQuaternion // FilterExponential is for floats of a multiple of 4 bytes, each a 24 bit mantissa and an 8 bit exponent. FilterExponential // FilterColor is for colors of 4 bytes (8 bit components) or 8 bytes (16 bit components). FilterColor )
The filters of the extension. FilterNone leaves the bytes as the vertex decoder made them.
Flutter: no counterpart