Skyline Lua API  Version 1.0
Lua Script Reference for Skyline Game Engine.
LUA_API_Vector3.h
Go to the documentation of this file.
1 // | _ ____ __ _
2 // | / \ _ _ _ __ __ _/ ___| ___ / _| |_
3 // | / _ \| | | | '__/ _` \___ \ / _ \| |_| __|
4 // | / ___ \ |_| | | | (_| |___) | (_) | _| |_
5 // | /_/ \_\__,_|_| \__,_|____/ \___/|_| \__|
6 // |
7 // | Aurasoft UK 2008 - 2018 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 - 2018
16 // |
17 
18 // SKYLINE LUA CLASS FOR API DOCUMENTATION
19 
37 class vector3
38 {
39 public:
40 
59  float dotProduct( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
60 
77  float absDotProduct( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
78 
95  float angle( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
96 
118  float3 crossProduct( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
119 
138  int directionEquals( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float tolerance );
139 
155  float distance( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
156 
177  float4 getRotationTo( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float fallbackVec_X, float fallbackVec_Y, float fallbackVec_Z );
178 
192  float3 midPoint( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
193 
208  float normalise( float vec1_X, float vec1_Y, float vec1_Z );
209 
219  float3 normalisedCopy( float vec1_X, float vec1_Y, float vec1_Z );
220 
233  float length( float vec1_X, float vec1_Y, float vec1_Z );
234 
244  int isNAN( float vec1_X, float vec1_Y, float vec1_Z );
245 
255  int isZeroLength( float vec1_X, float vec1_Y, float vec1_Z );
256 
269  float3 perpendicular( float vec1_X, float vec1_Y, float vec1_Z );
270 
286  int positionCloses( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float tolerance );
287 
303  int positionEquals( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float tolerance );
304 
314  float3 primaryAxis( float vec1_X, float vec1_Y, float vec1_Z );
315 
336  float3 randomDeviant( float vec1_X, float vec1_Y, float vec1_Z, float randomAngle, float vec2_X, float vec2_Y, float vec2_Z );
337 
353  float3 reflect( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
354 
373  float squaredDistance( float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z );
374 
389  float squaredLength( float vec1_X, float vec1_Y, float vec1_Z );
390 
391 };
int positionEquals(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float tolerance)
Returns whether this vector is within a positional tolerance of another vector.
float3 randomDeviant(float vec1_X, float vec1_Y, float vec1_Z, float randomAngle, float vec2_X, float vec2_Y, float vec2_Z)
Generates a new random vector which deviates from this vector by a given angle in a random direction...
float dotProduct(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Calculates the dot (scalar) product of this vector with another.
float3 perpendicular(float vec1_X, float vec1_Y, float vec1_Z)
Generates a vector perpendicular to this vector (eg an 'up' vector).
float absDotProduct(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Calculates the absolute dot (scalar) product of this vector with another.
float3 reflect(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Calculates a reflection vector to the plane with the given normal .
float3 primaryAxis(float vec1_X, float vec1_Y, float vec1_Z)
Extract the primary (dominant) axis from this direction vector.
int directionEquals(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float tolerance)
Returns whether this vector is within a directional tolerance of another vector.
float4 getRotationTo(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float fallbackVec_X, float fallbackVec_Y, float fallbackVec_Z)
Gets the shortest arc quaternion to rotate this vector to the destination vector. ...
int positionCloses(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z, float tolerance)
Returns whether this vector is within a positional tolerance of another vector, also take scale of th...
float angle(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Gets the angle between 2 vectors.
int isZeroLength(float vec1_X, float vec1_Y, float vec1_Z)
Returns true if this vector is zero length.
float3 crossProduct(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Calculates the cross-product of 2 vectors, i.e. vector that lies perpendicular to them both...
float normalise(float vec1_X, float vec1_Y, float vec1_Z)
Normalises the vector.
float squaredDistance(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Returns the square of the distance to another vector.
float length(float vec1_X, float vec1_Y, float vec1_Z)
Returns the length (magnitude) of the vector.
float distance(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Returns the distance to another vector.
int isNAN(float vec1_X, float vec1_Y, float vec1_Z)
Check whether this vector contains valid values.
Definition: LUA_API_Vector3.h:37
float squaredLength(float vec1_X, float vec1_Y, float vec1_Z)
Returns the square of the length(magnitude) of the vector.
float3 normalisedCopy(float vec1_X, float vec1_Y, float vec1_Z)
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy...
float3 midPoint(float vec1_X, float vec1_Y, float vec1_Z, float vec2_X, float vec2_Y, float vec2_Z)
Returns a vector at a point half way between this and the passed in vector.