Skip to content

explicit schemas #1

@NateTheGreatt

Description

@NateTheGreatt

it may be wise to use explicit schemas instead of using the SoA objects themselves as the schema, and then pass the SoA objects into the reader/writer functions themselves. this would allow reading/writing from/to different SoA objects that have the same schemas

e.g.

const n = 100

const Vector3SoA = { x: new Float32Array(n), y: new Float32Array(n), z: new Float32Array(n) }

const Vector3Schema = { x: Float32Array, y: Float32Array, z: Float32Array }

const config = [Vector3Schema]

const objects = [Vector3SoA]

const write = createDataWriter(config)
const read = createDataRead(config)

const indices = [1,2,3,4]
const data = write(objects, indices)

read(objects, data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions