Builds a new float32 attribute for given type and data.
(doc: Document, semantic: string, type: GLTF.AccessorType, array: Float32Array)
| 142 | |
| 143 | /** Builds a new float32 attribute for given type and data. */ |
| 144 | function createFloatAttribute(doc: Document, semantic: string, type: GLTF.AccessorType, array: Float32Array): Accessor { |
| 145 | const attribute = doc.createAccessor().setType(type).setArray(array); |
| 146 | const prim = doc.createPrimitive().setAttribute(semantic, attribute).setMode(Primitive.Mode.TRIANGLES); |
| 147 | doc.createMesh().addPrimitive(prim); |
| 148 | return attribute; |
| 149 | } |
no test coverage detected