Joints creating weirdly offset positions
Posted: Fri Jun 30, 2017 8:18 am
So I have a big object.
This object has, connected to it, several smaller objects.
The small objects are set to not collide with the big object.
Connecting the big object to the small objects is a few joints to control motion, and one key connector joint: The PointOnLineJoint.
It's constructed with:
(BigObject, SmallObject, small.Position, (0, 0, -1), small.Position)
so the small object's position is used for both reference points, the axis is 'straight down' the z axis, (relative to big object's orientation).
At time of construction of all this, both object's orientation's are an Identity quaternion.
I have the oddest problem here:
When the big object rotates, the small objects follow the rotation imperfectly: if the object angles its front end upwards along the Z axis (pitching up), the wheels will move extra far forward and up.
If the object angles downward along the Z axis (pitching down), the wheels move backwards (and thus upwards again)
Rotating /around/ the Z axis (yawing), they'll be offset to the side.
Rotating around the Y axis (Rolling), they'll again offset in whichever direction makes them the most upward.
They offset as much as 1 unit out of place, possibly 2 (eyeballing it).
They have a LinearAxisLimit that should restrict them from moving between 0 and 0.1 units on that axis,
and a servomotor LinearAxisMotor trying to push them 1 unit down that axis (possible issue with that being stronger than it needs to (1 unit down vs. 0.1 units down), but it /should/ be fine)
There are some other joints, but they have been move about in the past with no visible changes, so I'm going to guess those are irrelevant.
I'm at least halfway sure it's somewhere in the physics setup I have going, as opposed to the network or rendering logic being offput.
(Though, admittedly, not entirely. This setup is getting a bit complex and full of code I haven't looked at in long periods of time...)
So... my question is, do you have any ideas why this offset might be occurring?
This object has, connected to it, several smaller objects.
The small objects are set to not collide with the big object.
Connecting the big object to the small objects is a few joints to control motion, and one key connector joint: The PointOnLineJoint.
It's constructed with:
(BigObject, SmallObject, small.Position, (0, 0, -1), small.Position)
so the small object's position is used for both reference points, the axis is 'straight down' the z axis, (relative to big object's orientation).
At time of construction of all this, both object's orientation's are an Identity quaternion.
I have the oddest problem here:
When the big object rotates, the small objects follow the rotation imperfectly: if the object angles its front end upwards along the Z axis (pitching up), the wheels will move extra far forward and up.
If the object angles downward along the Z axis (pitching down), the wheels move backwards (and thus upwards again)
Rotating /around/ the Z axis (yawing), they'll be offset to the side.
Rotating around the Y axis (Rolling), they'll again offset in whichever direction makes them the most upward.
They offset as much as 1 unit out of place, possibly 2 (eyeballing it).
They have a LinearAxisLimit that should restrict them from moving between 0 and 0.1 units on that axis,
and a servomotor LinearAxisMotor trying to push them 1 unit down that axis (possible issue with that being stronger than it needs to (1 unit down vs. 0.1 units down), but it /should/ be fine)
There are some other joints, but they have been move about in the past with no visible changes, so I'm going to guess those are irrelevant.
I'm at least halfway sure it's somewhere in the physics setup I have going, as opposed to the network or rendering logic being offput.
(Though, admittedly, not entirely. This setup is getting a bit complex and full of code I haven't looked at in long periods of time...)
So... my question is, do you have any ideas why this offset might be occurring?