Author Topic: How to make a melee weapon push a vehicle.  (Read 1711 times)

oh wait wait wait it's the ratio between them
You still don't have a clue

0.5/1 = 50/100

am i rite or am i rong


No, really, I have no idea. Just basing that off of the posts in this topic.
What point are you trying to make?

i did find out that applying pythagoras' theorem to a vectorNormalize's results will always equal 1

looks like a ratio to me

i dunno, trying to understand vectors?

i've never used them, just trying to figure out how all the posts in this topic fit together

i did find out that applying pythagoras' theorem to a vectorNormalize's results will always equal 1

looks like a ratio to me
Ding ding ding
It returns the unit vector of a given vector

Ding ding ding
It returns the unit vector of a given vector

but I just said it was a ratio and you said it was wrong.

but I just said it was a ratio and you said it was wrong.
"A ratio" is not a unit vector


oh wait wait wait it's the ratio between them
You still don't have a clue
i did find out that applying pythagoras' theorem to a vectorNormalize's results will always equal 1

looks like a ratio to me
Ding ding ding
It returns the unit vector of a given vector

i said essentially the same thing and you suddenly tell me it's right

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: [Select]
function getDifVec(%orig,%pos,%vec)
{
    return vectorScale((vectorSub(%pos,%orig)),%mag);
}
%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

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.

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: [Select]
function getDifVec(%orig,%pos,%vec)
{
    return vectorScale((vectorSub(%pos,%orig)),%mag);
}
%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

Thank you.

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: [Select]
function getDifVec(%orig,%pos,%vec)
{
    return vectorScale((vectorSub(%pos,%orig)),%mag);
}
%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
%mag isn't defined.

%mag isn't defined.

There's nobody saying you can't replace it with a value.


You can check out the Homerun Bat for an example.
Quote
function HomerunBatSuperProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
   %damageType = $DamageType::Direct;
   if(%this.DirectDamageType)
      %damageType = %this.DirectDamageType;

   %scale = getWord(%obj.getScale(), 2);
   %directDamage = %this.directDamage * %scale;
   %col.damage(%obj, %pos, %directDamage, %damageType);
   serverPlay3d(HomerunBatSuperHitSound, %pos);
   if(%col.isDisabled())
   {
      %velocity = vectorScale(%obj.client.player.getEyeVector(), 35);
      %velocity = VectorAdd(%velocity, "0 0 45");
      %col.setVelocity(%velocity);

      %col.mountImage(HomerunnedImage, 0);
      if(getRandom(1, 50) == 37)
         serverPlay3d(HomerunBatHomerunSound, %pos);
   }
}
The bolded part is the bit relevant to you.

You can check out the Homerun Bat for an example.The bolded part is the bit relevant to you.
Just so he knows, this one shoots the object at the same direction of where the player is looking, as opposed to where the positions are versed