samp.directory
← Skrypty i biblioteki

Leonardo541/matrix

Matrix Functions for SA-MP

Filterscript★ 5zaktualizowano cze 2021MITPawn
Otwórz na GitHubie

README.md

Matrix Functions for SA-MP

https://youtu.be/vSZyMilgcuU

Functions (matrix.inc)

returnfunction
VECTORVector(Float:x, Float:y, Float:z);
MATRIXMatrix(const right[VECTOR], const front[VECTOR], const up[VECTOR], const pos[VECTOR]);
MATRIXMatrix_Invert(const matrix[MATRIX]);
Matrix_BuildUp(matrix[MATRIX]);
Matrix_SetRotation(matrix[MATRIX], Float:rx, Float:ry, Float:rz);
floatFloat:Matrix_GetRotationX(const matrix[MATRIX]);
floatFloat:Matrix_GetRotationY(const matrix[MATRIX]);
floatFloat:Matrix_GetRotationZ(const matrix[MATRIX]);
VECTORMatrix_GetRotation(const matrix[MATRIX]);
VECTORMatrix_Multiply3x3(const matrix[MATRIX], const vector[VECTOR]);
MATRIXMatrix_Multiply4x4(const matrix1[MATRIX], const matrix2[MATRIX]);
VECTORMatrix_GetOffsetPosition(const matrix[MATRIX], const vector[VECTOR]);
VECTORMatrix_GetOffsetRotation(const matrix[MATRIX], const vector[VECTOR], bool:invert = true);

Functions (matrix_example.inc)

returnfunction
MATRIXGetVehicleMatrix(vehicleid);
SetVehicleMatrix(vehicleid, mat[MATRIX]);
VECTORGetVehicleRot(vehicleid);
SetVehicleRot(vehicleid, rot[VECTOR]);
VECTORGetVehicleVelocityFrontVector(vehicleid)
SetVehicleVelocityFrontVector(vehicleid, vec[VECTOR]);

Commands (matrix_example1.pwn)

commanddescription
/matrixStart/Stop comparison between matrix, attach and i_quat
/attachAttach object to vehicle, with predefined offset
/attach_calc_offsetAttach object to vehicle, automatically calc offset
/detachdetach object from vehicle

Commands (matrix_example2.pwn)

commanddescription
/getvrotExample of GetVehicleRot
/setvrotExample of SetVehicleRot
/boostExample of SetVehicleVelocityFrontVector
/turboSame result as /boost

Thank to

IllidanS4 for i_quat, It allowed me to create the Matrix_BuildUp function based on GetVehicleRotationQuatFixed.
Zeex for amx_assembly, it allowed me to create the GetVehicleMatrix and SetVehicleMarix function. Thanks for that.
katursis for Pawn.RakNet, it allowed me to create the SetVehicleMarix function. Thanks for that.

Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem

Leonardo541/matrix: Filterscript SA-MP | samp.directory