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

CCD #366

Open
bllem opened this issue Mar 23, 2018 · 9 comments
Open

CCD #366

bllem opened this issue Mar 23, 2018 · 9 comments

Comments

@bllem
Copy link

bllem commented Mar 23, 2018

Hello.
Did a real shooting from the weapons in the shooter, and fought with the lack of ccd in cannon, but it is present in p1. Moves ccd into the cannon, and it works great. I removed the rotation, because I did for the bullets. Perhaps someone will need

https://github.com/bllem/cannon.js/commits/master

@dirkk0
Copy link

dirkk0 commented Mar 24, 2018

do you have a demo somewehere?

@bllem
Copy link
Author

bllem commented Mar 24, 2018

I have a video. By default, the CCD is turned on at a speed of 10+.
In this video, the balls are not bullets, but only a display of hits. A bullet with a diameter of 0.1 and it is represented by a physical object with a start velocity about 360
https://youtu.be/5WsRRIVgk3I

@dirkk0
Copy link

dirkk0 commented Mar 24, 2018

Wow, impressive!
All of this is done with ThreeJS and CannonJS?

@flerokoo
Copy link

Cool and just in time!
Although I've encountered a problem.
Take a look at those gifs:
usual cannon.js — https://gfycat.com/ContentSleepyBedlingtonterrier
cannon.js with CCD — https://gfycat.com/ContentShallowKingfisher

I control the ball by applying force (directed to the left or right).

With CCD, angularVelocity builds up too quickly, and then the ball gets thrown hard (look like in opposite direction of applied force, or maybe direction depends on angularVelocity, i don't know for sure). Without CCD it's stable, no unexpected speed ups.

@bllem
Copy link
Author

bllem commented Mar 24, 2018

I did not add a correction for angular acceleration and rotation, if it is necessary - I can add

@ubernaut
Copy link

that is a really cool looking demo!

@flerokoo
Copy link

@bllem It would be great to have full-blown CCD in cannon.js, so if you have the time... :)

@sinper0079
Copy link

I have used your new build of cannonjs but still not working , is that something need to set up?

@bllem
Copy link
Author

bllem commented Apr 2, 2018

in body options you can setup ccdSpeedThreshold - speed s at witch CCD starts to work and - ccdIterations collision accuracy.

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

5 participants