I
icuurd12b42
Guest
TMC Vectors
Outputs: All
Type: Scripts
Included: Scripts, Test Object, Test Room
Demo: None
Marketplace: https://marketplace....300/tmc-vectors
Description:
Add Vector Math To GM Studio!
Vector variable type and supporting functions like add, mult, cross product, dot, and much more!
type:
tmc_vect2, tmc_vect3, tmc_vect4
You can now convert commonly found vector math examples from all over the web for your game.
Example Bounce:
Code:
//bounce = -2*(V dot N)*N + V
var V = tmc_vect3(hspeed,vspeed,zspeed);
var N = tmc_vect_norm(tmc_vect3(x-other.x,y-other.y,z-other.z));
varVdN2=-2*tmc_vect_dot(V,N);
varVdN2N= tmc_vect_multr(N,VdN2);
varFinal= tmc_vect_add(VdN2N,V);
hspeed =Final[1]; //x
vspeed =Final[2]; //y
zspeed =Final[3]; //z
Last edited by a moderator: