Open T-MaxWiese-T opened 2 days ago
setVehicleComponentPosition
with collisions enabled could be useful if the collision spheres are actually configured with the correct collision component types (ie door, boot, special), but it doesn't really make sense to give setVehicleComponentRotation
a collision on/off toggle if the sphere would just rotate around its pivot, unless it actually rotates around the vehicle pivot?
setVehicleComponentPosition
with collisions enabled could be useful if the collision spheres are actually configured with the correct collision component types (ie door, boot, special), but it doesn't really make sense to givesetVehicleComponentRotation
a collision on/off toggle if the sphere would just rotate around its pivot, unless it actually rotates around the vehicle pivot?
Whereby, for example, car doors and trunks do not have a collision, i.e. a differentiation into types would probably not make sense here.
But the fire truck with ladder or the forklift with fork have a moving collision. You can see which models have a moving collision here: https://github.com/multitheftauto/mtasa-blue/blob/792d9aa6bbd6bdc451f3e78afacda5fdeb5df11b/Client/mods/deathmatch/logic/CClientVehicle.cpp#L1357
Regarding the rotation of the collision model not making a difference, yes I thought of that too, but it does make a difference. So in my code example with the forklift and the fork with the 180 degree rotation around the Z axis, the rotation of the collision model probably wouldn't make a difference, but if you rotated it 45 degrees for example it would make a difference. In the case of the fire truck with the ladder there, the rotation of the collision model definitely makes a difference.
The GTA function CAutomobile::UpdateMovingCollision
, which is responsible for moving the collision models, only accepts one parameter, namely the angle, but theoretically it would also be possible to completely change the position and rotation yourself.
Describe the bug
The function
setVehicleComponentRotation
andsetVehicleComponentPosition
does not change the position and rotation of the collision model. For example, changing the rotation of the fork of the forklift does not change the collision model rotation. This could lead to unwanted results.Steps to reproduce
Version
Client: v1.6-release-22763 Server: v1.6-release-22763
Additional context
I think the best solution would probably be to add an additional parameter to the
setVehicleComponentRotation
andsetVehicleComponentPosition
function that determines whether the vehicle component should have a collision or not so that the collision does not disturb if it is the case. With thesetVehicleAdjustableProperty
function, on the other hand, the collision model also shifts.Relevant log output
No response
Security Policy