Skip to content

Vector

Written by: Alian713, Kramb


1. xsVectorGetX

Returning Type: float

Prototype: float xsVectorGetX(vector v)

Parameters:

  1. vector v: The vector to get the X coordinate of

The X coordinate of the vector given.

2. xsVectorGetY

Returning Type: float

Prototype: float xsVectorGetY(vector v)

Parameters:

  1. vector v: The vector to get the Y coordinate of

The Y coordinate of the vector given.

3. xsVectorGetZ

Returning Type: float

Prototype: float xsVectorGetZ(vector v)

Parameters:

  1. vector v: The vector to get the Z coordinate of

The Z coordinate of the vector given.

4. xsVectorSetX

Returning Type: vector

Prototype: vector xsVectorSetX(vector v, float x)

Parameters:

  1. vector v: The vector to modify the X coordinate of
  2. float x: The value to set the X coordinate to

Returns a new vector with the X component of the given vector changed to the given value. Note: This function DOES NOT modify the vector given as the parameter!

5. xsVectorSetY

Returning Type: vector

Prototype: vector xsVectorSetY(vector v, float y)

Parameters:

  1. vector v: The vector to modify the Y coordinate of
  2. float y: The value to set the Y coordinate to

Returns a new vector with the Y component of the given vector changed to the given value. Note: This function DOES NOT modify the vector given as the parameter!

6. xsVectorSetZ

Returning Type: vector

Prototype: vector xsVectorSetZ(vector v, float z)

Parameters:

  1. vector v: The vector to modify the Z coordinate of
  2. float z: The value to set the Z coordinate to

Returns a new vector with the Z component of the given vector changed to the given value. Note: This function DOES NOT modify the vector given as the parameter!

7. xsVectorSet

Returning Type: vector

Prototype: vector xsVectorSet(float x, float y, float z)

Parameters:

  1. float x: The value to set the X coordinate to
  2. float y: The value to set the Y coordinate to
  3. float z: The value to set the Z coordinate to

Returns a vector with the given X, Y and Z components.

8. xsVectorLength

Returning Type: float

Prototype: float xsVectorLength(vector v)

Parameters:

  1. vector v: The vector to calculate the length of

Returns the length of the given vector.

9. xsVectorNormalize

Returning Type: vector

Prototype: vector xsVectorNormalize(vector v)

Parameters:

  1. vector v: The vector to normalise

Returns the normalised vector in the direction of the given vector.