Raycast vehicle drifting

Software: Away3D 4.x

dona, Jr. Member
Posted: 15 September 2012 06:21 PM   Total Posts: 46

Hi,

Sorry for the basic doubt,

I was trying to simulate drifts in Raycast vehicle? Should i need to add custom code for controlling the wheel friction other than vehicle tuning parameters?

Thanks

 

   

macaan, Newbie
Posted: 17 September 2012 04:22 PM   Total Posts: 30   [ # 1 ]

I tried a few things on this topic. Best working for me is a combination of setting the friction slip near or equal to zero when the car reaches a defined angel velocity or the skidfactor of the wheels go below 1.
There is a good way for faking it, you can give the rearwheels some steerin then the car looks like drifting while driving a little bit sideways through the turns…

it tooks quite a bit time to find good results. would be nice to directly go to the car behaviour, but then you have to take a different physics engine like jiglib flash.

also you can apply some torque or forces to the rear axle but that didn`t worked good for me.

btw it’s good to set linear and angulardamping to zero, ihave overseen this for a while and then it’s quite harder to go to drift.

   

dona, Jr. Member
Posted: 18 September 2012 05:39 AM   Total Posts: 46   [ # 2 ]

Thanks for your valuable answers, I’ve tried your first option, it gives best results.

I’ve one more doubt, is it possible to find out the colliding object with raycast vehicle’s wheel? I need to find out whether the vehicle is in air.

 

 

 

 

 

   

macaan, Newbie
Posted: 18 September 2012 07:46 AM   Total Posts: 30   [ # 3 ]

It would be nice if the isInContact function would be working. I have added an additional ray to check the actual ground the car is on.
To look if it’s flying you can look at the distance to the ground or even simpler if there is no collision it’s in the air..

   

dona, Jr. Member
Posted: 18 September 2012 08:42 AM   Total Posts: 46   [ # 4 ]

Thanks macaan, additional ray works, but isInContact always showing false even when the vehicle is on ground.[carBody.getWheelInfo(0).raycastInfo.isInContact]

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X