Skip to content

Spawn primitives with physics from scripts #104

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

saori-eth
Copy link
Collaborator

WIP implementation for spawning primitives with physics through scripts for generative content.

Current bugs:

  • sometimes the material takes a second to load
  • if i spawn around 5k rigidbodies at once i get memory overload. if i reduce it a bit, it lags but then runs max fps when they spawn

The AI went too far with the docs, this is just an example

@saori-eth saori-eth marked this pull request as draft June 23, 2025 18:02
@ashconnell
Copy link
Contributor

ashconnell commented Jun 24, 2025

I have a feeling it would feel less hacky if there was just a prim node that did both the collision and mesh together in one.
Then app code would simply be:

const box = app.create('prim', { 
  kind: 'box', 
  size: [1, 1, 1], 
  color: 'blue', 
  rigidbody: 'static' 
})
app.add(box)

And that would create both the mesh and the collider behind it.
Everything would be completely isolated inside one single nodes/Prim.js file

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

Successfully merging this pull request may close these issues.

2 participants