Physics direction problem!

I have a problem in my game
when I force the ball it is Crooked how can I fix it?
my friends tested my game and they tell me physics direction is wrong!

Record_2019_03_02_20_33_49_215

Are you sure that you are hitting the ball dead center? It looks off center to me.

1 Like

yeah I’m sure
I apply force in forward direction of cue
but I don’t know what is problem!

var dir = this.entity.forward;
dir.mul2(dir,new pc.Vec3(power,power,power));

I agree with wtuber. The GIF in this thread that you have shown looks correct. The white ball is hitting the brown on the right side.

Also, given the speed and size of the balls, you may want to enable continuous collision detection and/or increase the rate that the physics gets updated.

yeah I need it!
how can I have continuous collision detection
I want to increase physics accuracy

I tried to config a physics like this but I couldn’t do that
http://jaks6.github.io/WebGL-Billiards/

my friends tell me playcanvas isn’t good and we should switch another engine
but I believe we should tweak physics to achieve a physics like above link

Looks like jaks6 is using Cannon as the physics engine (which you can use if you want instead of Ammo.js).

CCD can be enabled by accessing parts of Ammo that isn’t exposed by PlayCanvas (https://developer.playcanvas.com/en/tutorials/physics-with-ccd/)

To increase the physics rate, you have to start digging into the engine source.

I saw that Continuous Collision Detection it’s good but I like to change physics
it seems hard I couldn’t use use Cannon!
can you take an example that how can I use Cannon?
http://schteppe.github.io/cannon.js/

I don’t have a project using Cannon but here’s one using a small part of Oimo so you can get the idea. If you decide that you don’t want Ammo, you have you to remove ALL rigidbodies and ALL collision components from every object (you can group select them in the hierarchy and remove/add/edit components/scripts en mass to make it easier).

https://playcanvas.com/project/548514/overview/oimo-physics-test

Basically, you have to do the whole integration yourself.

Record_2019_03_03_17_32_10_49

I could fix this problem by adding auto aim :sunglasses::ok_hand: