Skyline Lua API  Version 1.0 RC1
Lua Script Reference for Skyline Game Engine.
LUA_API_Vector2.h
Go to the documentation of this file.
1 // | _ ____ __ _
2 // | / \ _ _ _ __ __ _/ ___| ___ / _| |_
3 // | / _ \| | | | '__/ _` \___ \ / _ \| |_| __|
4 // | / ___ \ |_| | | | (_| |___) | (_) | _| |_
5 // | /_/ \_\__,_|_| \__,_|____/ \___/|_| \__|
6 // |
7 // | Aurasoft UK 2008 - 2016 http://www.aurasoft.co.uk
8 // |
9 // | Skyline Game Engine Lua API Documentation
10 // |
11 // | This file belongs to Aurasoft UK for the Skyline Game Engine of all versions.
12 // | This file is not for use in any other software that is not owned by Aurasoft UK and cannot be used by any other
13 // | person outside of the Skyline Game Engine development team.
14 // |
15 // | Copyright - Aurasoft UK & Skyline Game Engine 2008 - 2016
16 // |
17 
18 // SKYLINE LUA CLASS FOR API DOCUMENTATION
19 
37 class vector2
38 {
39 public:
40 
57  float dotProduct( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
58 
73  float angle( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
74 
89  float angleTo( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
90 
103  float crossProduct( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
104 
118  float distance( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
119 
131  float2 midPoint( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
132 
145  float normalise( float vec1_X, float vec1_Y );
146 
154  float2 normalisedCopy( float vec1_X, float vec1_Y );
155 
167  float length( float vec1_X, float vec1_Y );
168 
177  int isNAN( float vec1_X, float vec1_Y );
178 
187  int isZeroLength( float vec1_X, float vec1_Y );
188 
200  float2 perpendicular( float vec1_X, float vec1_Y );
201 
213  float2 randomDeviant( float vec1_X, float vec1_Y, float randomAngle );
214 
228  float2 reflect( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
229 
246  float squaredDistance( float vec1_X, float vec1_Y, float vec2_X, float vec2_Y );
247 
261  float squaredLength( float vec1_X, float vec1_Y );
262 
263 };
float distance(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Returns the distance to another vector.
float squaredDistance(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Returns the square of the distance to another vector.
float2 normalisedCopy(float vec1_X, float vec1_Y)
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy...
float2 randomDeviant(float vec1_X, float vec1_Y, float randomAngle)
Generates a new random vector which deviates from this vector by a given angle in a random direction...
int isNAN(float vec1_X, float vec1_Y)
Check whether this vector contains valid values.
float2 midPoint(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Returns a vector at a point half way between this and the passed in vector.
float2 perpendicular(float vec1_X, float vec1_Y)
Generates a vector perpendicular to this vector (eg an 'up' vector).
float crossProduct(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Calculates the 2 dimensional cross-product of 2 vectors, which results in a single floating point val...
Definition: LUA_API_Vector2.h:37
float angleTo(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Gets the oriented angle between 2 vectors.
float2 reflect(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Calculates a reflection vector to the plane with the given normal .
int isZeroLength(float vec1_X, float vec1_Y)
Returns true if this vector is zero length.
float squaredLength(float vec1_X, float vec1_Y)
Returns the square of the length(magnitude) of the vector.
float normalise(float vec1_X, float vec1_Y)
Normalises the vector.
float dotProduct(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Calculates the dot (scalar) product of this vector with another.
float angle(float vec1_X, float vec1_Y, float vec2_X, float vec2_Y)
Gets the angle between 2 vectors.
float length(float vec1_X, float vec1_Y)
Returns the length (magnitude) of the vector.