Skip to content

Queries for Dynamic Components #635

Answered by zicklag
zicklag asked this question in Q&A
Discussion options

You must be logged in to vote

I was successfully able to introduce state into queries and establish a dynamic system! I've still got to do some cleanup work and I have to do more testing, but the existing bevy queries continue to work without changes and without a performance regression according to ECS bench run before and after my commits. Here is the current branch. I'll be cleaning it up and moving it to #623.

Here's the example code that sets up a runtime-created system:

use std::time::Duration;

use bytemuck::{Pod, Zeroable};

use bevy::prelude::*;
use bevy_app::ScheduleRunnerPlugin;
use bevy_ecs::{
    Access, ComponentId, DynamicComponentAccess, DynamicComponentInfo, DynamicComponentQuery,
};

// Define our co…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@zicklag
Comment options

zicklag Oct 6, 2020
Collaborator Author

Comment options

zicklag
Oct 6, 2020
Collaborator Author

You must be logged in to vote
5 replies
@zicklag
Comment options

zicklag Oct 7, 2020
Collaborator Author

@zicklag
Comment options

zicklag Oct 7, 2020
Collaborator Author

@zicklag
Comment options

zicklag Oct 9, 2020
Collaborator Author

@cart
Comment options

cart Oct 9, 2020
Maintainer

@cart
Comment options

cart Oct 9, 2020
Maintainer

Comment options

zicklag
Oct 9, 2020
Collaborator Author

You must be logged in to vote
1 reply
@zicklag
Comment options

zicklag Oct 10, 2020
Collaborator Author

Answer selected by zicklag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants