Alessandro Posted September 11, 2010 Share Posted September 11, 2010 Hello, since I need to make a realistic vehicle, I wanted to create it using Newton joints. I'm not so experienced in LE, so I started using DRIVER.LUA (just to get a guideline). Now I notice that such script uses CreateObject() to create the vehicle (chassis is the only real physics thing). Instead I need to create chassis + wheels (as BODY in order to apply sliderJoint). I cannot find the right way to start from. After the user start the program, the object chassis will be created: function class:CreateObject(model) Then... local object = self.super:CreateObject(model) object.vehicle = CreateVehicle(object.model) Ok, where and how can I load wheel physics? In the original code the wheels do not exist as physic entities. Do you suggest me to create separated tire and its related PHY file? Or can I use the tire already stored in the vehicle model ( see VIPER as an example)? Please highlight my dark way since I'm very confused. Thank you for your help! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 14, 2010 Share Posted September 14, 2010 I would try to make one model with the tires as seperated bones. But I have no further experience in creating vehicles. Quote Link to comment Share on other sites More sharing options...
Canardia Posted September 14, 2010 Share Posted September 14, 2010 You can use wheels with a physics model and still do it like in the driver.lua example. The wheels will collide with things just fine, but of course they won't get any force impact back since you use SetEntityMatrix() on them which eliminates reverse physics force. But collisions still work fine. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Alessandro Posted September 14, 2010 Author Share Posted September 14, 2010 You can use wheels with a physics model and still do it like in the driver.lua example. The wheels will collide with things just fine, but of course they won't get any force impact back since you use SetEntityMatrix() on them which eliminates reverse physics force. But collisions still work fine. Please can you better explain me what you mean? Quote Link to comment Share on other sites More sharing options...
Canardia Posted September 14, 2010 Share Posted September 14, 2010 Just do it like in the driver.lua example, but replace LoadMesh() for the wheels with LoadModel() in vehicle_viperscout.lua, and add physics bodies to your wheel models. Nothing else needed. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Alessandro Posted September 14, 2010 Author Share Posted September 14, 2010 Just do it like in the driver.lua example, but replace LoadMesh() for the wheels with LoadModel() in vehicle_viperscout.lua, and add physics bodies to your wheel models. Nothing else needed. Well, I did it, but nothing changed. Car behaviuor is exactly the same. Quote Link to comment Share on other sites More sharing options...
Canardia Posted September 14, 2010 Share Posted September 14, 2010 Did you set EntityType() and mass for the wheels? And Collisions() for the wheels to collide with other stuff. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Alessandro Posted September 14, 2010 Author Share Posted September 14, 2010 Did you set EntityType() and mass for the wheels? And Collisions() for the wheels to collide with other stuff. Ok, I will try. But can you tell me if, in this way, I can get a more realisitic vehicle instead of an arcade-style car? Quote Link to comment Share on other sites More sharing options...
Canardia Posted September 14, 2010 Share Posted September 14, 2010 No, it doesn't affect the car behavior, it only adds more realistic collisions for the wheels when you collide with other loose objects. You can adjust some car behaviors with the spring dampening settings. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
VeTaL Posted September 14, 2010 Share Posted September 14, 2010 I'll ask in another way: Lumooja, dont you know, what's with multibody, not DG raycast car on Newton forum? Is it still supported and is it still possible to make multibody car? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Canardia Posted September 14, 2010 Share Posted September 14, 2010 LE doesn't use Newton's car, although I think it would be better. However, it seems to be possible also to use Bullet in LE, I'm playing around with that. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
VeTaL Posted September 15, 2010 Share Posted September 15, 2010 I know, that LE doesnt use Newton's car, i'm curious, why Newton dont use Newton multibody car Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Alessandro Posted September 16, 2010 Author Share Posted September 16, 2010 Hello, I finally tried to implement your suggestion, but not work. In fact, if I do not apply EntityType for collision, then nothing changed (car behaviour does not change), instead if I apply entitytype as: EntityType(object.tire[n], 1) Well, LE hangs (slow down the entire engine!). I think it is logical, since vehicle built functions created by Josh use a different way (rays) to simulate wheels collision, so I think those methods go in conflict. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.