PDA

View Full Version : Body linking


nige777
03-05-2008, 04:04 PM
Hi,
I'm developing a training environment where the user must operate a fork lift truck and be able to get on and off. I have set up the fork lift using physics joints and motors so that it "behaves" correctly, which it does-to a certain, pretty much.
Firstly when I pick up the objects with the forks that need loading and stacking (cages made with collideBox's top and bottom) there is a noticeable 'wobble', to the point when it looks unrealistic. Is this a trade off of using a bunch of dynamic physics shapes held together with physics joints?
Secondly when linking the viewpoint to the fork lift I loose control of the head, I presume it is the head_ori that is linked is it? I have tried using setMask but to no avail:(.I have tried using this:

#TIMER
def onTimer(num):
# #The timer with the id 'num' has expired
if num == 0:
#Link matrix of runners to forks(turning)
turn = run.getMatrix()
turn.preTrans(0,1.6,0)
view.setMatrix(turn,viz.BODY_ORI)

viz.callback(viz.TIMER_EVENT,onTimer)
viz.starttimer(0,viz.FASTEST_EXPIRATION,viz.FOREVE R)


which does what I want but produces REALLY bad juddering when the truck is moving.

Am I missing something really simple here?

Regards

Nige

nige777
03-06-2008, 09:05 AM
Hi all wizards,

Juddering experienced whilst moving has been improved by tweaking setStepSize and setAccuracy, although it is not perfect (yet), and the cages still cause the forks to wobble, I am more confident that I can achieve acceptable results.

Take it easy

farshizzo
03-06-2008, 09:27 AM
The following code should link to rotation of the fork lift to the view body:bodyLink = viz.link(forkLift,viz.MainView,mask=viz.LINK_ORI,d stFlag=viz.LINK_BODY)

nige777
03-06-2008, 02:17 PM
Cheers man,

ended up using
bodyLink = viz.link(body,view,dstFlag=viz.LINK_BODY)
as the exact line of code you gave me only linked the orientation of the body(or head?) i think as the view didn't move with the truck, but hey, thanks again for your help.

Regards,
Nige