[ODE] Character control
Troy Chard
troy.chard at shaw.ca
Mon Jul 21 16:29:02 2003
--Boundary_(ID_vrq3UkZvW5Ytc7yo1eBPwg)
Content-type: text/plain; charset=us-ascii; format=flowed
Content-transfer-encoding: 7BIT
At 08:52 PM 7/20/03 +0100, you wrote:
>Hi.
>
>One area I'm kind of stuck on right now is making the characters in my
>game (a 3rd person style game) interact
>with the physics environment in a correct manor. I use a simple box to
>represent them at the moment.
>
>The main problems are:
>
>1. The character should always be standing vertically, whereas naturally
>any physical collisions tend to
>make the box wobble on all axis'. I'm fixing this by just manually setting
>the rotation each frame but it
>doesn't feel like a very good way to do it.
>There will be certain circumstances where I want to allow free rotation's
>(player has been killed, or is
>flying off after a nearby explosion etc.)
>
>2. I need a mix of "direct control" and physics response from ODE.
>For example, I want perfect control over the orientation and velocity of
>the player according to the player
>input (including things like instantly stopping when the player stops
>pressing forwards). But if for example,
>he walks over 'see-saw' or a falling object strikes him then its the
>physics that has more baring on his resultant
>position. I guess if I can solve No.1 in more friendly way, this be easier.
>
>I hope my general problem has got across adequately.
>I'm looking for any pointers or ideas for what I should try out next.
>Any help greatly appreciated!
>
>Thanks
>igrok.
>
I've thought about this problem myself. I haven't come up with a good
solution though.
One way of looking at the problem is perhaps to simulate the forces that
act on the body.
I've tried that in a limited way, but again with problems.
Perhaps one solution is to write a class which contains a rigid body and
logic for keeping
its balance by exerting forces on itself (up to a certain
threshhold). Then the body can be
moved around world without falling over unless it's whacked by some force
greater than
it's balance recovery threshhold.
It's not really rigidbody physics, but seems to be a variation that people
are looking
for for using ode with their video games. (oh and i'm not suggesting a
class to be made
within ode, this is just a general thought on the problem).
I think it may be a little non-trivial, but would be curious if others have
ideas on this.
Troy
--Boundary_(ID_vrq3UkZvW5Ytc7yo1eBPwg)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: 7BIT
<html>
At 08:52 PM 7/20/03 +0100, you wrote:<br>
<blockquote type=cite cite><font face="arial" size=2>Hi.</font><br>
<br>
<font face="arial" size=2>One area I'm kind of stuck on right now is
making the characters in my game (a 3rd person style game)
interact</font><br>
<font face="arial" size=2>with the physics environment in a correct
manor. I use a simple box to represent them at the moment.</font><br>
<br>
<font face="arial" size=2>The main problems are:</font><br>
<br>
<font face="arial" size=2>1. The character should always be standing
vertically, whereas naturally any physical collisions tend
to</font><br>
<font face="arial" size=2>make the box wobble on all axis'. I'm fixing
this by just manually setting the rotation each frame but it</font><br>
<font face="arial" size=2>doesn't feel like a very good way to do
it.</font><br>
<font face="arial" size=2>There will be certain circumstances where I
want to allow free rotation's (player has been killed, or is</font><br>
<font face="arial" size=2>flying off after a nearby explosion
etc.)</font><br>
<br>
<font face="arial" size=2>2. I need a mix of "direct control"
and physics response from ODE.</font><br>
<font face="arial" size=2>For example, I want perfect control over the
orientation and velocity of the player according to the
player</font><br>
<font face="arial" size=2>input (including things like instantly stopping
when the player stops pressing forwards). But if for
example,</font><br>
<font face="arial" size=2>he walks over 'see-saw' or a falling object
strikes him then its the physics that has more baring on his
resultant</font><br>
<font face="arial" size=2>position. I guess if I can solve No.1 in more
friendly way, this be easier.</font><br>
<br>
<font face="arial" size=2>I hope my general problem has got across
adequately.</font><br>
<font face="arial" size=2>I'm looking for any pointers or ideas for what
I should try out next.</font><br>
<font face="arial" size=2>Any help greatly appreciated!</font><br>
<br>
<font face="arial" size=2>Thanks</font><br>
<font face="arial" size=2>igrok.</font><br>
</blockquote><br>
I've thought about this problem myself. I haven't come up with a
good solution though.<br>
<br>
One way of looking at the problem is perhaps to simulate the forces that
act on the body.<br>
I've tried that in a limited way, but again with problems.<br>
<br>
Perhaps one solution is to write a class which contains a rigid body and
logic for keeping<br>
its balance by exerting forces on itself (up to a certain
threshhold). Then the body can be <br>
moved around world without falling over unless it's whacked by some force
greater than<br>
it's balance recovery threshhold.<br>
It's not really rigidbody physics, but seems to be a variation that
people are looking<br>
for for using ode with their video games. (oh and i'm not
suggesting a class to be made<br>
within ode, this is just a general thought on the problem).<br>
<br>
I think it may be a little non-trivial, but would be curious if others
have ideas on this.<br>
<br>
Troy<br>
</html>
--Boundary_(ID_vrq3UkZvW5Ytc7yo1eBPwg)--