When an event occurs in a ball (such as a collision with another object ...) How can you get the total force applied to

Tell us about your game or application that uses Box2D.
infinitypocket
Posts: 1
Joined: Thu Aug 31, 2017 11:45 pm

When an event occurs in a ball (such as a collision with another object ...) How can you get the total force applied to

Postby infinitypocket » Fri Sep 01, 2017 12:23 am

Hello everyone ~
I'm making games using a box2d engine.
I want to know the force that the ball strikes the wall and protrudes from the wall and is applied to the ball.
I'm making real-time multiplayer games. I need to show my ball movements to the other players as well ....

The way I envisioned is not to send the ball's coordinates to the opponent every frame ... when the ball first starts ... when the ball has an event ...

I send the power applied to the ball to the opponent ... and I am trying to move it the same way.
The first way to force the ball when the ball starts is by using the function called ApplyLinearImpulse ().

I want to show the movement of the ball to the other user equally when an event occurs in the ball from one user.

To achieve this, I used the GetLinearVelocity function to get the velocity ... I put this value in the ApplyLinearImpulse.

Results did not move equally on both sides.

When an event occurs in a ball (such as a collision with another object ...) How can you get the total force applied to the ball?

Return to “Games and Applications”



Who is online

Users browsing this forum: No registered users and 1 guest