View Single Post
  #4  
Old 06-12-2009, 02:35 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Hey, been a while since you posted this example for me farshizzio - been busy busy busy with a literature review / search since then so I have only just got back to finishing this project off!!

I have (fairly) successfully implemented yr slider motor class & it works great THANKS, however, I still have a couple of problems that I would like to run past u :-

- How could I replace the keyboard control event for joystick buttons? I was using a timer to look for a joy.isButtonDown event but seem unable figure out a way of using this method with yr wonderful SliderMotor class!
- When lowering the forks sometimes the item that I was carrying (cages or pallets) get 'stuck' in thin air and only drop if they get knocked by the forks - have tried various combinations of settings for 'setStepSize' and 'setAccuracy' but nothing seems to help that much!
Here is the code for the cages:
Code:
top =cage1.collideBox(node = 'Cage_Top',bounce=0)
top.setFriction(0.5)
bottom = cage1.collideBox(node = 'Cage_Bottom',bounce=0)
bottom.setFriction(0.5)
side1=cage1.collideBox(node='Left_Ones',bounce=0)
side2=cage1.collideBox(node='Right_Ones',bounce=0)
cage1.enable(viz.COLLIDE_NOTIFY)
-the pallets are dealt with in a similar manner.

The forklift is a purely physics based affair rather than being based upon animations or links (as I had already mentioned last yr), with the blades of the fork lift being dealt with like this:
Code:
fork1 = flt.getChild('Blades')
forks = fork1.collideBox(bounce=0)
fork1.enable(viz.COLLIDE_NOTIFY)
forks.setFriction(1)
What, in your opinion, would be the best approach to sort this out? I would REALLY appreciate any light you may be able to throw on this problem,

Thanks in advance
Reply With Quote