Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity find closest point on line

public Vector2 FindNearestPointOnLine(Vector2 origin, Vector2 direction, Vector2 point)
{
    direction.Normalize();
    Vector2 lhs = point - origin;

    float dotP = Vector2.Dot(lhs, direction);
    return origin + direction * dotP;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# create datatable 
Csharp :: c# 8 null coalescing assignment 
Csharp :: close window from page xaml 
Csharp :: how to store more data than doublec# 
Csharp :: stock span problem c# 
Csharp :: link nuttom in c# 
Csharp :: vuln.c nc mercury.picoctf.net 59616 
Csharp :: c# find index element array 
Csharp :: c# random choice 
Csharp :: tooltip button winform 
Csharp :: How to Create Hint, PlaceHolder Text, Watermark In a TextBox vb.net 
Csharp :: index in foreach c# 
Csharp :: .NET Microsoft.dotnet-httprepl 
Csharp :: xamarin timer example 
Csharp :: How do I remove all non alphanumeric characters from a string? 
Csharp :: c sharp check if key in dictionary 
Csharp :: c# sort array of objects by multiple properties 
Csharp :: c# byte array to string 
Csharp :: c# two different random numbers 
Csharp :: unity put children in list 
Csharp :: dictionary c# 
Csharp :: c# search on google 
Csharp :: unity animate post processing values 
Csharp :: text split 
Csharp :: c# shuffle array 
Csharp :: Xamarin.Forms - How to navigate to a tabbed page child page 
Csharp :: get text component unity 
Csharp :: start command line from c# 
Csharp :: tooltips unity 
Csharp :: c# LCP 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =