Back to class index
| Ray::ClosestPointSyntaxfloat3 Ray::ClosestPoint(const float3 &targetPoint, float *d=0) const; [7 lines of code]float3 Ray::ClosestPoint(const Ray &other, float *d=0, float *d2=0) const; [5 lines of code] float3 Ray::ClosestPoint(const Line &other, float *d=0, float *d2=0) const; [4 lines of code] float3 Ray::ClosestPoint(const LineSegment &other, float *d=0, float *d2=0) const; [5 lines of code] Computes the closest point on this ray to the given object. If the other object intersects this ray, this function will return an arbitrary point inside the region of intersection. Parametersfloat *d [out]If specified, receives the parametric distance along this ray that specifies the closest point on this ray to the given object. The value returned here can be negative. This pointer may be null.float *d2 [out]If specified, receives the parametric distance along the other line that specifies the closest point on that line to this ray. The value returned here can be negative. This pointer may be null. Performancefloat3 Ray::ClosestPoint(const float3 &targetPoint, float *d=0) const12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps). 41.053nsecs/call ≈ 24.36M calls/second ≈ 405.98k calls/frame (@ 60fps). 41.053nsecs/call ≈ 24.36M calls/second ≈ 405.98k calls/frame (@ 60fps). 36.947nsecs/call ≈ 27.07M calls/second ≈ 451.09k calls/frame (@ 60fps). See AlsoWork in progress:Bug: in float3 Ray::ClosestPoint(const Ray &other, float *d=0, float *d2=0) const: Properly cap d2. Bug: in float3 Ray::ClosestPoint(const LineSegment &other, float *d=0, float *d2=0) const: Properly cap d2. Leave a Comment |