Blockland Forums > Modification Help
How to make a melee weapon push a vehicle.
Treynolds416:
--- Quote from: ThinkInvisible on June 10, 2012, 11:34:56 AM ---but I just said it was a ratio and you said it was wrong.
--- End quote ---
"A ratio" is not a unit vector
ThinkInvisible:
--- Quote from: Treynolds416 on June 10, 2012, 11:19:47 AM ---
--- Quote from: ThinkInvisible on June 10, 2012, 10:52:02 AM ---oh wait wait wait it's the ratio between them
--- End quote ---
--- Quote from: Treynolds416 on June 10, 2012, 10:49:18 AM ---You still don't have a clue
--- End quote ---
--- End quote ---
--- Quote from: Treynolds416 on June 10, 2012, 11:32:03 AM ---
--- Quote from: ThinkInvisible on June 10, 2012, 11:24:41 AM ---i did find out that applying pythagoras' theorem to a vectorNormalize's results will always equal 1
looks like a ratio to me
--- End quote ---
Ding ding ding
It returns the unit vector of a given vector
--- End quote ---
i said essentially the same thing and you suddenly tell me it's right
Treynolds416:
The important part is that the magnitude is one. You're making a big deal out of nothing, you know what it is now.
Anyway I feel guilty for partly filling this thread up with bullstuff, so here's the math you need
--- Code: ---function getDifVec(%orig,%pos,%vec)
{
return vectorScale((vectorSub(%pos,%orig)),%mag);
}
--- End code ---
%orig is the would be the position of the golf club head, %pos is where it hits the object, %mag is how hard you want the hit to be
Xalos:
Think, normalization of a vector is, as Treynolds said, finding the unit vector - that is, changing the length (magnitude) of the vector so that it's one unit long - hence, unit vector.
Dr.Tyler O.:
--- Quote from: Treynolds416 on June 10, 2012, 12:02:22 PM ---The important part is that the magnitude is one. You're making a big deal out of nothing, you know what it is now.
Anyway I feel guilty for partly filling this thread up with bullstuff, so here's the math you need
--- Code: ---function getDifVec(%orig,%pos,%vec)
{
return vectorScale((vectorSub(%pos,%orig)),%mag);
}
--- End code ---
%orig is the would be the position of the golf club head, %pos is where it hits the object, %mag is how hard you want the hit to be
--- End quote ---
Thank you.