Initially I was normalizing a vector and multiplying it with a large number to add an impulse to a object something like
FVector Direction = StartLocation - ThrowLocation;
Direction.Normalize();
PickedUpActor->ObjectMesh->AddImpulse(Direction *50000);
The results were slightly inaccurate so I thought of using something like this
double DirectionX = (double)(StartLocation.X - ThrowLocation.X);
double DirectionY = (double)(StartLocation.Y - ThrowLocation.Y);
double DirectionZ = (double)(StartLocation.Z - ThrowLocation.Z);
DirectionZ /= 7;
double Size = FMath::Sqrt((DirectionX*DirectionX) + (DirectionY*DirectionY) + (DirectionZ*DirectionZ));
DirectionX /= Size;
DirectionY /= Size;
DirectionZ /= Size;
double ThrowMagnitude = 50000;
PickedUpActor->ObjectMesh->AddImpulse(FVector(ThrowMagnitude * DirectionX, ThrowMagnitude * DirectionY, ThrowMagnitude * DirectionZ));
I wanted to know will this give any accuracy advantage compared to what I used previously?