Closed JakobTischler closed 10 years ago
you have to "rightly" set the centerOfMass for each component. please make another screenshot with the magic F5 key pressed (to see where are the collision boxes on this model)
Are you sure the first component is the "body" on this model ? sometimes, the first component is the "attacher bar"... (and so, if your "bar" is 1T and the body 100kgs, you get what you set ;))
Yes, 100% sure concerning the components:
Ursus Z586: loadFinished(): component 1 (42105/"ursusZ586"): angularDamping set to 0, linearDamping set to 0
Ursus Z586: loadFinished(): component 2 (42166/"ursusZ586_arm"): angularDamping set to 0, linearDamping set to 0
Ursus Z586: loadFinished(): component 3 (42167/"ursusZ586_support"): angularDamping set to 0, linearDamping set to 0
And also, the grabber itself doesn't have any collision:
But I'm now pretty sure the problem lies rather with the centerOfMass
. I moved it back 1m on the main component, and now it stands as it should. Should have thought of that before.
Thanks for the help.
The main problem is that we don't know where is the "origin" of each component in the i3d model. and so, we have to "test and try" to get the right values. Don't forget to use the "debugmode" to see the mass on each wheel (for "mr" vehicles and implements) => I always use it to check the mass the implement puts on the tractor and the mass on each implement's wheel
The main problem is that we don't know where is the "origin" of each component in the i3d model. and so, we have to "test and try" to get the right values.
Let's help with that, shall we? :)
Add this to the end of addMoreRealistic.lua
:
local drawComponents = function(self, dt)
if not self.isActive --[[or not self.isSelected]] then return; end;
for i=1, #self.components do
local node = self.components[i].node;
local compX,compY,compZ = getWorldTranslation(node);
drawDebugPoint(compX,compY,compZ, 0, 1, 0, 1);
local x, y, z = getCenterOfMass(node);
if x ~= 0 or y ~= 0 or z ~= 0 then
local massX,massY,massZ = localToWorld(node, x, y, z);
drawDebugPoint(massX,massY,massZ, 1, 1, 0, 1);
drawDebugLine(compX,compY,compZ, 0, 1, 0, massX,massY,massZ, 1, 1, 0);
end;
end;
end;
Vehicle.update = Utils.appendedFunction(Vehicle.update, drawComponents);
really nice. Thank you !
When I detach the wrapper while it is unfolded, it doesn't stand still but rather falls to the grabber's side. Only that the grabber doesn't seem to have a collision, so it goes through the terrain.![balewrapper_detached_unfolded](https://cloud.githubusercontent.com/assets/748857/3042776/937b3306-e100-11e3-9951-f2479b4cabb1.jpg)
When the wrapper is folded though, it stands as intended, not falling to the right side.![balewrapper_detached_folded](https://cloud.githubusercontent.com/assets/748857/3042781/9a405068-e100-11e3-9aed-70b39d8924f9.jpg)
Anyone got an idea how to solve this? The mass distribution is: main component: 1t, support: 0.1t, grabber: 0.1t