Jump to content

Matrices for vehicle components please


AfterAll14

Recommended Posts

  • 3 weeks later...
  • 2 weeks later...
On 12/27/2016 at 1:30 PM, Fierelier said:

Wouldn't that break compatibility to older scripts? It would not be that hard to convert these values to a vector yourself, or to write a function for it that does it automatically for you.

The requirement is that you access it using OOP.

vec = vehicle:getComponentRotation(...)
x, y, z = getVehicleComponentRotation(vehicle, ...)

 

Link to comment

@qaisjp Well, actually what I originally meant by this suggestion was something like that:

local matrix = vehicle:getComponentMatrix(..)
vehicle:setComponentMatrix("dummy", matrix)

As I started digging into MTA source by myself, it turned out adding this feature is quite easy. I'm going to include it in this update.

I'm not planning to add vectors for return value for position/rotation, cause as @Fierelier said it could lead to compatibility issues. But if MTA devs think its necessary - so be it :)

update:

took a brief look at wiki - looks like getComponentPosition/getComponentRotation methods are not documented, though they are in the MTA code. So I think that means you can add vectors as return values. Those who used older versions should blame themselves then for using non-documented funcs :P

update 2:

ok, its actually poorly documented in the end xD:

https://wiki.multitheftauto.com/wiki/OOP_client#Vehicle

Edited by AfterAll14
Link to comment
  • 9 months later...
  • MTA Anti-Cheat Team

As you might know this was implemented earlier in response to this suggestion, only to be reverted later due to causing script compatibility issues.

Now, in 1.5.5 (latest revision only) it's added back (r11712 onwards)

https://wiki.multitheftauto.com/wiki/Changes_in_1.5.5 > Scripting > Client > ''Return vectors for vehicles component funcs (#9507)"

@AfterAll14 @Einheit-101

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...