Determining if a force is making a difference

  • Thread starter Thread starter DrSammyD
  • Start date Start date
  • Tags Tags
    Difference Force
AI Thread Summary
A game developer is seeking a solution for determining animation speed based on character movement and interactions with walls and treadmills. The key challenge is differentiating between scenarios where the character's running animation should play or not, depending on their velocity relative to the ground or treadmill speed. A proposed solution involves creating variables for ground speed, character speed, and animation speed, with the animation speed calculated as the difference between the two. The discussion also touches on the importance of position variables and time in determining interactions and collisions. Ultimately, the developer is exploring whether it's feasible to measure the impact of a single force on an object's velocity given multiple forces and past velocity data.
DrSammyD
Messages
21
Reaction score
0
So I'm creating a game. I have a physics engine in the game. There's a use case that I've come up with that I don't know how to solve.

Imagine a character is running
1.
---------0 ------------------>
-------------------------------------------

then it hit's a wall
2.
---------0>| BLAM!
-------------------------------------------

now it's no longer moving forward.

now Imagine a character running on a treadmill
3.
---------0>
-----<------<-----<------<-----<------<

Then a wall comes down the treadmill
4.
<-------0| BLAM!
-----<------<-----<------<-----<------<

Or the character is running on a treadmill but not fast enough to keep up
5
-----<--0
-----<------<-----<------<-----<------<

I need a variable that will determine that cases 1 and 3 are the same, and 2 and 4 are the same, when the only information I have are the forces acting on the character (the ground, the box, friction etc.), the force that the character is providing itself (e.g. the running force), and the character's velocity.

I'm trying to determine the speed at which the running animation should be played. clearly in cases 2 and 4, it should not be playing, in 1 and 3, it should be, and in 5, it should be playing, but more slowly than in case 1 and 3. I was multiplying the animation speed by the velocity, but then I realized it wouldn't work in the case of the treadmill

Is this possible with the information I have? If not what other possible information combinations do I need?

The short question is, how do you measure if a single force is changing the velocity of an object given all other forces acting on it and it's current (and perhaps past if I need to record it) velocity, and if so, how much.
 
Last edited:
Physics news on Phys.org
I say don't worry about forces. I don't see how they can help your case here. Just worry about velocity. And, perhaps position.

Make a variable for the speed of the ground (or treadmill): G
Make another variable for the speed of the character: V
Make another variable for the speed at which the running animation should play: A=V-G

You might need to make position variables for the wall, the ground, and the character. The position of each will obviously change depending on their speed and time...so you'll need a time variable as well.
The position of the wall can be fixed to a position of the ground.
Make a case that when the position of the character=position of the wall, then V=G

Simple. I should have been a computer programmer :P
 
If you do want to use forces, here is how you go about it.

1) Running must apply a constant force in specific direction.
2) There must be friction with the supporting surface. Make sure to take relative velocities into account.
3) Collisions must apply forces. This is a tricky one. Simplest thing is to compute how far object A went into object B and use Hook's Law. However, this will generally cause objects to separate with a bit more velocity than they hit. It's a good idea to also apply friction during collisions. It can solve the above problem, and allow you to make slightly different collisions between different materials.
 
Is there a way to get the relative velocity based on the force of the friction it's applying to me?
 
Thread ''splain this hydrostatic paradox in tiny words'
This is (ostensibly) not a trick shot or video*. The scale was balanced before any blue water was added. 550mL of blue water was added to the left side. only 60mL of water needed to be added to the right side to re-balance the scale. Apparently, the scale will balance when the height of the two columns is equal. The left side of the scale only feels the weight of the column above the lower "tail" of the funnel (i.e. 60mL). So where does the weight of the remaining (550-60=) 490mL go...
Consider an extremely long and perfectly calibrated scale. A car with a mass of 1000 kg is placed on it, and the scale registers this weight accurately. Now, suppose the car begins to move, reaching very high speeds. Neglecting air resistance and rolling friction, if the car attains, for example, a velocity of 500 km/h, will the scale still indicate a weight corresponding to 1000 kg, or will the measured value decrease as a result of the motion? In a second scenario, imagine a person with a...
Scalar and vector potentials in Coulomb gauge Assume Coulomb gauge so that $$\nabla \cdot \mathbf{A}=0.\tag{1}$$ The scalar potential ##\phi## is described by Poisson's equation $$\nabla^2 \phi = -\frac{\rho}{\varepsilon_0}\tag{2}$$ which has the instantaneous general solution given by $$\phi(\mathbf{r},t)=\frac{1}{4\pi\varepsilon_0}\int \frac{\rho(\mathbf{r}',t)}{|\mathbf{r}-\mathbf{r}'|}d^3r'.\tag{3}$$ In Coulomb gauge the vector potential ##\mathbf{A}## is given by...

Similar threads

Back
Top