/// <summary> /// 射线检测Actor /// </summary> /// <param name="ray">指定的射线</param> /// <param name="layerid">参与检测的层</param> /// <returns>射线检测到Actor(射线从起点发出,第一个检测到的Actor),若没有检测到任何Actor,返回NULL</returns> static public Actor IntersectWorld_Actor(ref Ray ray, LayerID layerid) { if (LayerID.Min <= layerid && layerid < LayerID.Max) { return(ICall_IntersectWorld_Actor(ref ray, LayerMark.LayerIDToUINTMark(layerid))); } return(null); }
/// <summary> /// 射线检测指定的Actor /// </summary> /// <param name="act">要检测的Actor</param> /// <param name="ray">射线</param> /// <param name="layerid">参与检测的层</param> /// <param name="pos">射线打到Actor上的点的坐标</param> /// <returns>是否检测到Actor</returns> static public bool IntersectActor(Actor act, ref Ray ray, LayerID layerid, out Vector3 pos) { if (LayerID.Min <= layerid && layerid < LayerID.Max && act != null) { return(ICall_IntersectWorld_IntersectActor(act, ref ray, LayerMark.LayerIDToUINTMark(layerid), out pos)); } pos = Vector3.Zero; return(false); }
/// <summary> /// 获取射线与指定(网格)Actor的交点 /// </summary> /// <param name="act">要检测的Actor</param> /// <param name="ray">要检测的射线</param> /// <param name="mark">Actor的过滤层(只有这个层的Actor参与射线检测)</param> /// <param name="pos">射线与Actor的焦点</param> /// <returns>射线与Actor是否有交点</returns> static public bool IntersectActor(Actor act, ref Ray ray, LayerMark mark, out Vector3 pos) { if (act != null) { return(ICall_IntersectWorld_IntersectActor(act, ref ray, mark.MarkAsUINT, out pos)); } pos = Vector3.Zero; return(false); }
/// <summary> /// 获取射线检测到场景里(网格)Actor的第一个点的坐标 /// </summary> /// <param name="ray">指定的射线</param> /// <param name="layerid">参与检测的层</param> /// <param name="outPoint">返回值(检测到的第一个点的坐标)</param> static public void IntersectWorld_Point(ref Ray ray, LayerID layerid, out Vector3 outPoint) { if (LayerID.Min <= layerid && layerid < LayerID.Max) { ICall_IntersectWorld_Point(ref ray, LayerMark.LayerIDToUINTMark(layerid), out outPoint); } else { outPoint = Vector3.Zero; } }
/// <summary> /// 获取射线打中的第一个网格上的三角形的三个点 /// </summary> /// <param name="ray">指定的射线</param> /// <param name="mark">Actor的过滤层(只有这个层的Actor参与射线检测)</param> /// <param name="outPoint1">三角形的第一个点</param> /// <param name="outPoint2">三角形的第二个点</param> /// <param name="outPoint3">三角形的第三个点</param> static public void IntersectWorld_Triangle(ref Ray ray, LayerMark mark, out Vector3 outPoint1, out Vector3 outPoint2, out Vector3 outPoint3) { ICall_IntersectWorld_Triangle(ref ray, mark.MarkAsUINT, out outPoint1, out outPoint2, out outPoint3); }
/// <summary> /// 获取射线打中的第一个(网格)Actor的交点 /// </summary> /// <param name="ray">指定的射线</param> /// <param name="mark">Actor的过滤层(只有这个层的Actor参与射线检测)</param> /// <param name="outPoint">射线与第一个Actor的交点</param> static public void IntersectWorld_Point(ref Ray ray, LayerMark mark, out Vector3 outPoint) { ICall_IntersectWorld_Point(ref ray, mark.MarkAsUINT, out outPoint); }
/// <summary> /// 获取射线打中的第一个(网格)Actor /// </summary> /// <param name="ray">指定的射线</param> /// <param name="mark">Actor的过滤层(只有这个层的Actor参与射线检测)</param> /// <returns></returns> static public Actor IntersectWorld_Actor(ref Ray ray, LayerMark mark) { return(ICall_IntersectWorld_Actor(ref ray, mark.MarkAsUINT)); }
/// <summary> /// 获取射线与指定(网格)Actor的交点 /// </summary> /// <param name="act">要检测的Actor</param> /// <param name="ray">要检测的射线</param> /// <param name="mark">Actor的过滤层(只有这个层的Actor参与射线检测)</param> /// <param name="pos">射线与Actor的焦点</param> /// <returns>射线与Actor是否有交点</returns> static public bool IntersectActor(Actor act, ref Ray ray, LayerMark mark, out Vector3 pos) { return(ICall_IntersectWorld_IntersectActor(act, ref ray, mark.MarkAsUINT, out pos)); }