31.05.2015, 05:41
(
Last edited by codectile; 04/06/2015 at 03:24 PM.
Reason: colours
)
linearMath
Introduction
Linear mathematics plugin for sa-mp. This plugin is based upon Bullet's LinearMath library, to provide fast and efficient vector as well as quaternion math calculations. It completely utilizes, Single Instruction, Multiple Data (SIMD) method of parallel computing which makes it fast as well as efficient.
Functions
Code:
//vectors native AddVectors(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x, &Float:y, &Float:z); native Float:DotProduct(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2); native CrossProduct(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:x, &Float:y, &Float:z); native Float:GetVectorAngle(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2); native Float:GetDistance(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2); native Float:GetMagnitude(Float:x, Float:y, Float:z); native GetNormalized(Float:x, Float:y, Float:z , &Float:nx, &Float:ny, &Float:nz); native GetClosestAxis(Float:x, Float:y, Float:z); native GetFurthestAxis(Float:x, Float:y, Float:z); native RotateVector(Float:x, Float:y, Float:z, Float:ax, Float:ay, Float:az, Float:angle, &Float:rx, &Float:ry, &Float:rz); native GetReflectedVector(Float:x, Float:y, Float:z, Float:nx, Float:ny, Float:nz, &Float:rx, &Float:ry, &Float:rz); //quaternions native Float:GetQuaternionAngle(Float:x, Float:y, Float:z, Float:w); native GetAxisOfRotation(Float:x, Float:y, Float:z, Float:w, &Float:x1, &Float:y1, &Float:z1); native Float:DotProductQuaternion(Float:x1, Float:y1, Float:z1, Float:w1, Float:x2, Float:y2, Float:z2, Float:w2); native Float:GetQuaternionMagnitude(Float:x, Float:y, Float:z, Float:w); native Float:GetInverseQuaternion(Float:x, Float:y, Float:z, Float:w, &Float:ix, &Float:iy, &Float:iz, &Float:iw);
https://github.com/codectile/linearMath
Note: Now there is a support for Linux systems. But the .so library won't be updated, to use the updated library, compile it your favorable OS.