reflect

function

reflect()

Description

Reflects the vector off the vector defined by a mirror 'plane'.

Arguments

Name Type Description
_plane vec2 The mirror to reflect the vector off.

Returns

vec2 The reflected vector.

Example

vec1 = new Vec2(2, 3);
vec2 = new Vec2(4, 4);
show_debug_message(vec1.reflect(vec2)); // Result: { x : -3.00, y : -2.00 }

Copyright © 2020, eL-Falso. Built on December 14, 2020 using GMDoc.