Home > Enterprise >  Dot function in unreal c
Dot function in unreal c

Time:01-16

This is the code in Unreal C

float GetT( float t, float alpha, const FVector& p0, const FVector& p1 )
{
    auto d  = p1 - p0;
    float a = d | d; // Dot product
    float b = FMath::Pow( a, alpha*.5f );
    return (b   t);
}

Does this line means "float a = d | d; // Dot product" dot product of FVector d with itself

https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline

CodePudding user response:

Look for documentation of FVector. Search "operators". Look for |. Find:

float     

operator|

(
    const FVector& V
)     

Calculate the dot product between this and another vector.

Yes. d | d calculates the dot product of the vector with itself.

  •  Tags:  
  • Related