Hi Guys,
I am using RaycastVehicle for a vehicle simulation and have collision with walls. How can I customize the collision with the walls so my vehicle won’t top over when colliding at high speeds? Anybody have any clue?
Thanks in advance
RayCast vehicle to wall collisionSoftware: Away3D 4.x |
||
ron~, Newbie
Posted: 16 February 2013 04:01 PM Total Posts: 15 Hi Guys, I am using RaycastVehicle for a vehicle simulation and have collision with walls. How can I customize the collision with the walls so my vehicle won’t top over when colliding at high speeds? Anybody have any clue? Thanks in advance |
||
|
||
|
||
Daniel88, Newbie
Posted: 21 February 2013 03:27 AM Total Posts: 6 [ # 3 ] To make things look smoother you might want to change the collider or manually change the center of mass to the back of the chassis, or move it around dynamically, or apply some force or angular velocity proportional to the angle (linearly, squared or cubed or w/e) between up axis of the vehicle and the world up axis, that will counter-act the rotation. |
||
Luca, Sr. Member
Posted: 21 February 2013 07:04 AM Total Posts: 230 [ # 4 ] Sry, but i have little time. I agree with what he says Daniel88 I have make some test, and i have a little demo here: I don’t have problem when the kart collide whit walls, so do you need to get something like this ? Or publish the code you use for example i use this: //———————————————————————————————————————————————————————- // effectively shifts the center of mass with respect to the chassis // the get the right position for the shape, ( which is a mesh created around the model in 3ds max ) i use this code else if( ( FilterMeshName( mesh.name ) == “CollisionBB1” ) ) Unfortunately the Away implenteation of Bullet are not complete and has some differences from the original… time to time i suppose… |
||
ron~, Newbie
Posted: 21 February 2013 09:05 AM Total Posts: 15 [ # 5 ] Thanks a lot for sharing your knowledge, As per Daniel’s suggestion, I have moved the center of mass to back of the chassis. Now its showing better results. I think by applying a central impulse ,fine tuning the values of restitution and friction between the car and wall can be smooth the results as well. Thanks Luca for your extreme help for resolving this issue. Since its a client game, I’m restricted to upload a playable demo. But I’ve uploaded a video of that issue: http://www.youtube.com/watch?v=TmX7-vb_w-4&feature=youtu.be Thank You |
||
Luca, Sr. Member
Posted: 21 February 2013 09:25 AM Total Posts: 230 [ # 6 ] With pleasure, but I want to challenge you in your game ( like neeeeeeed foooooor speeeeeeeeeeed or Gran Turismo ) ha so do you know this: http://www.smartfoxserver.com/ and for the AI try look this:
|
||
ron~, Newbie
Posted: 21 February 2013 09:45 AM Total Posts: 15 [ # 7 ] haha thats a good idea. Supertuxkart is always a good reference, its an amazing team work too. Also you can support supertuxkart here: http://twtpoll.com/ragr0e |
||
Luca, Sr. Member
Posted: 21 February 2013 10:55 AM Total Posts: 230 [ # 8 ] but you can also use: //——————————————————————————————————————————————————————- // Now we just find the relative position of the waypoint from the car transform, // This just checks if the car’s position is near enough to a waypoint to count as passing it, } challenge, challenge, challenge….. |
||
|