Skip to content

Conversation

@Qwlouse
Copy link
Collaborator

@Qwlouse Qwlouse commented Jul 21, 2022

This was a draft for adding custom forces during the simulation.
Can be used like this:

random_forces = {
    obj.linked_objects[simulator]: {
        20*i+rng.randint(1, 20): (rng.uniform(*velocity_range), 0.2)
        for i in range(25)}
    for obj in scene.foreground_assets
}
animation, collisions = simulator.run(frame_start=0, frame_end=scene.frame_end+1, forces=random_forces)

The design is not ideal, because it requires listing the forces beforehand, so they cannot depend on dynamic state of the objects. Maybe a callback would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant