Simple character movement in 3d environment

Started by
2 comments, last by tonemgub 10 years, 5 months ago

I'm currently trying to implement some basic character movement for a first person game I'm working on, but I've run into some problems.

Let's say there's an outside force that applies a velocity of Vector(500,60,0) to my character. For the sake of this example, let's say that force is constant and doesn't decrease.

Now the player starts moving in a random direction, like Vector(0.827846,0.560955,0).

How can I determine how much more the player can accelerate in that direction without going over the bounds of his max movement speed?

I basically need to retrieve the speed of the outside force in the player's movement direction.

Any suggestions?

How's this usually handled in other games?

Advertisement

Why do you need to determine that? I would think you just compute the sum of all forces on the character and integrate. If you want to impose a maximum movement speed, I can think of several ways to do it:

1) limit the velocity vector's magnitude explicitly,

2) introduce drag,

3) make the force applied by the character's locomotion system depend on how fast he's going,

4) Lorenz contraction (this is mostly a joke).

I basically need to retrieve the speed of the outside force in the player's movement direction.

Normalize vector of player direction, and make dot product of normalized direction and the velocity vector arising from outside force.

Doesn't "player's max movement speed" actually refer to the speed/velocity that is generated by the player's own, internal forces? I've never heard of limiting external forces. You'll basically end up limitng things like gravity - I don't think that's your intent.

This topic is closed to new replies.

Advertisement