DMath.dot(a,b);
a - { First vector } b - { Second vector}
Returns the scalar dot product of two same-typed vectors a and b.
dot implementation for a float3 vector.
float dot(float3 a, float3 b)
{
return a.x*b.x + a.y*b.y + a.z*b.z;
}
dot is usually very inexpensive, but it can get a little more expensive if used in loops, but nothing that creates major bottlenecks.