GSC reference › Built-in
VectorFromLineToPoint()
Built-in (engine)
Server + client
Math
Given a line and a point P, this returns a vector perpendicular to the line and pointing from the line to P.
Signature
VectorFromLineToPoint(<SegmentA>, <SegmentB>, <P>)
Parameters
| Name | Required? | Details |
|---|---|---|
| SegmentA | Required | One point on the line |
| SegmentB | Required | Another point on the line |
| P | Required | The point |
Example (from Treyarch's docs)
myvector = VectorFromLineToPoint( A, B, P )
Real uses in BO3's scripts
Not called anywhere in BO3's shipped scripts, so check it works in your mode before relying on it.
Related built-ins
- MayMoveFromPointToPoint()Check whether the actor can move from a given point to a given point.
- RotatePoint()Returns <angle> lerped angle value.
- PointOnSegmentNearestToPoint()Given a line segment and a point P, this returns the point on the segment that is closest to P.
- RotatePointAroundAxis()Returns a vector that is the result of point rotated around the axis vector by num degrees
- GetClosestPointOnNavMesh()Get a point on NavMesh that's closest to the given position within radius.
- IsPointOnNavMesh()Checks if a given point is valid on the NavMesh.
- SessionModeIsOnlineGame()Returns true/false if the current session mode is onlinegame
- GetItemIndexFromRef()Returns the item index for the specified item reference
- GetClosestPointOnNavVolume()Get a point on nav volume that's closest to the given position within radius.
- SetDemoIntermissionPoint()Sets the intermission point for the demos.
- GetWeaponMuzzlePoint()Returns the weapon's muzzle point
- SpawnFromSpawner()Spawns an actor or vehicle from a spawner, if possible (the spawner won't spawn if the player is looking at the spawn point, or if spawning would...
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).