- #1
DrSammyD
- 21
- 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.
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: