Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit schemas #1

Open
NateTheGreatt opened this issue Jan 30, 2022 · 0 comments
Open

explicit schemas #1

NateTheGreatt opened this issue Jan 30, 2022 · 0 comments

Comments

@NateTheGreatt
Copy link
Contributor

NateTheGreatt commented Jan 30, 2022

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant