示例#1
0
float float4::AngleBetween3(const float4 &other) const
{
    float cosa = Dot3(other) / sqrt(LengthSq3() * other.LengthSq3());
    if (cosa >= 1.f)
        return 0.f;
    else if (cosa <= -1.f)
        return pi;
    else
        return acos(cosa);
}
示例#2
0
文件: float4.cpp 项目: Ilikia/naali
float float4::AngleBetween4(const float4 &other) const
{
    return acos(Dot4(other)) / sqrt(LengthSq3() * other.LengthSq3());
}