Character movement using vehicle class

pra

12-01-2007 20:40:50

I tried char movement with the vehicle class, it even works quite ok, but:
how can i make the tire fixed to a certain position? The mesh of the char moves up and down a few times if it jumps, that's not good if it stands on the floor while not moving.

I noticed the mass of the tire affects it's suspension. If it's too light, the chassis will touch the floor, even with the hardest and shortest spring. why?

Or, should I reposition the mesh's node each frame, setting it to the tire's position instead of attaching it to the chassis? (tire->updateNode() would rotate it, that's undesired)

pra

14-01-2007 16:36:44

a screenshot to show what i mean. i made the tires visible:

I could not nake a good sreenshot of jumping, but while trying i noticed that a heavy tire can make problems...
The ninja.mesh's node is attached to m_chassis. I want to ensure that the feet of the ninja always touch the floor.

pra

18-01-2007 22:25:19

ok, i give up. vehicle class is for vehicles and not for character movement.

now i'll try it with a joint that works similar to the vehicle. it seems to attach the tire like i wanted it to, i will add the actual movement stuff on Saturday (no time tomorrow) and post the code if it works

nikhil

19-03-2007 11:39:33

what happened.. i'm really interested in what you were trying to achieve.. I'm working on a skating sim and I've been working for months trying to get a gud physics simulation for it, no luck.. all the time I've been trying by pushing cylinders or spheres with no friction so they don't roll and so doesn't my char.. but this is bad when I've to bank along turns.. I want something like two tires connected by some form of rigid link..
May be one tire will do, I'm not sure. Will the tire fall on it's side if there's just one of it..


Regards

Nik

pra

19-03-2007 18:44:50

nothing happened... i gave up this idea, and returned to dragging a capsule...

no, the tire won't fall over if you mean this, but my problem was that the tire won't stay on it's horizontal position, there is always suspension, and it is affected by the tire's mass somehow....

nikhil

20-03-2007 10:22:34

nothing happened... i gave up this idea, and returned to dragging a capsule...

no, the tire won't fall over if you mean this, but my problem was that the tire won't stay on it's horizontal position, there is always suspension, and it is affected by the tire's mass somehow....


umm.. so u mean he was always 'bouncing a bit' ? .. i can live with that in my game.. if possible can u email me ur vehicle-character code at nikhil dot accenture at gmail dot com..

walaber

20-03-2007 15:10:46

would be cool for a unicycle game :)

pra

20-03-2007 16:54:35

oh, the master chief himself posted^^
do you know why suspension is affected by tire mass?

@nikhil: sorry, i don't have it anymore :(
i've totally rewirtten my character class, with some ideas from another thread from this board. i think i'll post it somewhen here, the only reason i haven't done it yet is that i would have to remove the references to the rest of my code (like my level class)

but it wasn't that difficult, i looked at the ogrenewt vehicle demo and did it similar. you have to inherit from the ogrenewt vehicle class, the tire class can be used directly, then you add a upvector jont to your char's body, and to move, you add torque to the tire. to move sidewards, you can adjust the "steering angle" of the tire. just look at the vehicle example, if i was able to do it, you'll do it, too^^

nikhil

22-03-2007 07:00:47

k.. no probs dood.. i'll try it out and have my fingers crossed ... :D

walaber

23-03-2007 02:18:08

not sure why suspension is affected by tire mass... that's a question for the makers of Newton :)