Ejemplo n.º 1
0
    public static Vector3 GetVector3(GtMsg.Vec3 v3)
    {
        Vector3 v = new Vector3();

        v.x = v3.X;
        v.y = v3.Y;
        v.z = v3.Z;
        return(v);
    }
Ejemplo n.º 2
0
    //public static bool SameSideEX(Vector3 A, Vector3 B, Vector3 C, Vector3 P)
    //{
    //    Vector3 BA = B - A;
    //    Vector3 CA = C - A;
    //    Vector3 PA = P - A;

    //    Vector3 v1 = Vector3.Cross(BA, CA);
    //    Vector3 v2 = Vector3.Cross(BA, PA);//a × b = |a| |b| sin(θ) n

    //    // v1 and v2 should point to the same direction
    //    return Vector3.Dot(v1, v2) >= 0;// v1.Dot(v2) >= 0;点乘的结果越大,表示两个向量越接近
    ////}
    public static GtMsg.Vec3 GetVec3(Vector3 v3)
    {
        GtMsg.Vec3 v = new GtMsg.Vec3();
        v.X = v3.x;
        v.Y = v3.y;
        v.Z = v3.z;

        return(v);
    }