open.mp forum
[include] Matrix Functions (Topic en Espa?ol) - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: Other languages (https://forum.open.mp/forumdisplay.php?fid=23)
--- Forum: Spanish/Espa?ol (https://forum.open.mp/forumdisplay.php?fid=24)
---- Forum: Programaci?n (https://forum.open.mp/forumdisplay.php?fid=51)
---- Thread: [include] Matrix Functions (Topic en Espa?ol) (/showthread.php?tid=1602)



[include] Matrix Functions (Topic en Espa?ol) - Leonardo - 2021-01-27

Matrix Functions



Estas son funciones matrix, que se pueden usar para obtener la rotaci?n de euler de un veh?culo, o calcular el offset para usarlo en AttachObjectToVehicle/Player, tambi?n para crear un DetachObjectFromVehicle/Player, etc.



Functions:


  • native Vector(Float:x, Float:y, Float:z);

  • native Matrix(const right[VECTOR], const front[VECTOR], const up[VECTOR], const pos[VECTOR]);

  • native Matrix_Invert(const matrix[MATRIX]);

  • native Matrix_BuildUp(matrix[MATRIX]);

  • native Matrix_SetRotation(matrix[MATRIX], Float:rx, Float:ry, Float:rz);

  • native Float:Matrix_GetRotationX(const matrix[MATRIX]);

  • native Float:Matrix_GetRotationY(const matrix[MATRIX]);

  • native Float:Matrix_GetRotationZ(const matrix[MATRIX]);

  • native Matrix_GetRotation(const matrix[MATRIX]);

  • native Matrix_Multiply3x3(const matrix[MATRIX], const vector[VECTOR]);

  • native Matrix_Multiply4x4(const matrix1[MATRIX], const matrix2[MATRIX]);

  • native Matrix_GetOffsetPosition(const matrix[MATRIX], const vector[VECTOR]);

  • native Matrix_GetOffsetRotation(const matrix[MATRIX], const vector[VECTOR], bool:invert = true);


Video



?ste es un video del filterscript de pruebas:



[Video: https://youtu.be/vSZyMilgcuU]





C?digo fuente



https://github.com/Leonardo541/matrix