Vector.GetNormal
From GMod Wiki
Function | |
Syntax | Vector:GetNormal( ) |
Description: | |
Returns a copy of the vector with a length of exactly 1. | |
Returns: | Vector |
In Object: | Vector |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Vector.GetNormal]Vector.GetNormal [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Normalizes a vector. |
---|---|
Used on | |
Code | local vec = Vector( 300, 150, 150 ):Normalize() |
Output | Vector( 1, 0.5, 0.5 ) |
Additional Notes
- Normalized vectors are also called "unit vectors". Their length is exactly 1 unit.
- Unlike Vector.Normalize , this only returns value, without modifying the original vector.