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

[Question] allow Shape sleep #101

Closed
arpu opened this issue Jul 14, 2021 · 6 comments
Closed

[Question] allow Shape sleep #101

arpu opened this issue Jul 14, 2021 · 6 comments

Comments

@arpu
Copy link

arpu commented Jul 14, 2021

Hey,

would it be possible to allow Shape sleep? the idea is to have one body with multiple Trimesh Shapes
and lets the Shape sleep if the Character is not near. ( near distance could be done with bvh https://github.com/gkjohnson/three-mesh-bvh)

@arpu
Copy link
Author

arpu commented Jul 14, 2021

a other Idea is use a option like the world.broadphase.useBoundingBoxes = true;
with the bvh boundingTree

@marcofugaro
Copy link
Member

What's wrong with Body sleep?

https://pmndrs.github.io/cannon-es/examples/sleep

@arpu
Copy link
Author

arpu commented Jul 14, 2021

Yes i looked at this too, but with this i need to create a body for all Trimeshes, not sure if this is a problem or not

Bildschirmfoto von 2021-07-14 13-38-44

right now i create one body with multible Trimeshes and use world.broadphase.useBoundingBoxes

@marcofugaro
Copy link
Member

Should work the same, have you tested it?

@arpu
Copy link
Author

arpu commented Jul 14, 2021

no, but for one Model it would make sense to use one body? and multiple Shapes

@arpu
Copy link
Author

arpu commented Jul 14, 2021

ok with multible bodys and one Trimesh per body, sleeping works well!
not sure if this has any disadvantage.

closing for now

@arpu arpu closed this as completed Jul 14, 2021
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

2 participants