You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function setVehicleComponentRotation and setVehicleComponentPosition 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
Drive against a vehicle with the fork in a forklift.
Execute this client code while sitting in a forklift:
function fork()
setVehicleComponentRotation(getPedOccupiedVehicle(localPlayer), "misc_a", 0, 0, 180)
addCommandHandler("fork", fork)
Hit the vehicle again with the fork. Although the fork rotation has changed, the rotation of the collision model has not changed.
I think the best solution would probably be to add an additional parameter to the setVehicleComponentRotation and setVehicleComponentPosition 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 the setVehicleAdjustableProperty function, on the other hand, the collision model also shifts.
Relevant log output
No response
Security Policy
I have read and understood the Security Policy and this issue is not security related.
The text was updated successfully, but these errors were encountered:
T-MaxWiese-T
changed the title
Function "setVehicleComponentRotation” does not change the position and rotation of the collision model
Function "setVehicleComponentRotation/Position” does not change the position and rotation of the collision model
Oct 21, 2024
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 give setVehicleComponentRotation 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:
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 the
setVehicleAdjustableProperty
function, on the other hand, the collision model also shifts.Relevant log output
No response
Security Policy
The text was updated successfully, but these errors were encountered: