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

can you give a load_asset example? #146

Closed
cats2333 opened this issue Sep 3, 2023 · 5 comments
Closed

can you give a load_asset example? #146

cats2333 opened this issue Sep 3, 2023 · 5 comments
Labels
question Further information is requested

Comments

@cats2333
Copy link

cats2333 commented Sep 3, 2023

Can you give me an example of loading a third-party model to generate collisions? I loaded a third-party model myself to generate collisions, which became very slow

@Jondolf Jondolf added the question Further information is requested label Sep 3, 2023
@Jondolf
Copy link
Owner

Jondolf commented Sep 3, 2023

What method are you currently using for generating the collider? Are you using Collider::trimesh_from_bevy_mesh or Collider::convex_decomposition_from_bevy_mesh? If the model is an asset like a gltf file, you'll need "async scene colliders" which aren't built-in yet, but you can implement them in your own app pretty easily, see #104 and #135.

Also, do you mean that generating the collider at the start of the app takes time, or that the performance is bad when objects are interacting with the collider? If you're using convex decomposition, it's expected that the initial load is very slow because of the underlying algorithm, but we might be able to fix this in the future using Bevy's asset rework.

@cats2333
Copy link
Author

cats2333 commented Sep 4, 2023

world.txt
Thank you very much for your reply! This is an. rs file. I put it in main, but I'm not very good at it. The rendering is fine, but the imported mesh did not collide, Gltf loads quickly, but runs slowly, almost stuck, Can you help me take a look? Thank you again!

@cats2333
Copy link
Author

cats2333 commented Sep 4, 2023

i use Collider::trimesh_from_bevy_mesh

@cats2333
Copy link
Author

cats2333 commented Sep 4, 2023

Yesterday I saw you have an example of a third-party gltf import that you are about to upload. Let me take a look at that first?

@cats2333
Copy link
Author

cats2333 commented Sep 4, 2023

Another small issue is, if multiple third-party models need to be loaded during startup, their previous order cannot be guaranteed. Do I need to merge them into one load

@cats2333 cats2333 closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants