sf::Vector3< T > Class Template Reference

Utility template class for manipulating 3-dimensional vectors. More...

#include <Vector3.hpp>

List of all members.

Public Member Functions

 Vector3 ()
 Default constructor.
 Vector3 (T X, T Y, T Z)
 Construct the vector from its coordinates.

Public Attributes

x
 X coordinate of the vector.
y
 Y coordinate of the vector.
z
 Z coordinate of the vector.

Detailed Description

template<typename T>
class sf::Vector3< T >

Utility template class for manipulating 3-dimensional vectors.

sf::Vector3 is a simple class that defines a mathematical vector with three coordinates (x, y and z).

It can be used to represent anything that has three dimensions: a size, a point, a velocity, etc.

The template parameter T is the type of the coordinates. It can be any type that supports arithmetic operations (+, -, /, *) and comparisons (==, !=), for example int or float.

You generally don't have to care about the templated form (sf::Vector3<T>), the two most common specializations have special typedefs:

The sf::Vector3 class has a small and simple interface, its x and y members can be accessed directly (there's no accessor like SetX(), GetX()) and it contains no mathematical function like dot product, cross product, length, etc.

Usage example:

 sf::Vector3f v1(16.5f, 24.f, -8.2f);
 v1.x = 18.2f;
 float y = v1.y;
 float z = v1.z;

 sf::Vector3f v2 = v1 * 5.f;
 sf::Vector3f v3;
 v3 = v1 + v2;

 bool different = (v2 != v3);

Note: for 2-dimensional vectors, see sf::Vector2.

Definition at line 37 of file Vector3.hpp.


Constructor & Destructor Documentation

template<typename T>
sf::Vector3< T >::Vector3 (  ) 

Default constructor.

template<typename T>
sf::Vector3< T >::Vector3 ( X,
Y,
Z 
)

Construct the vector from its coordinates.

Parameters:
X X coordinate
Y Y coordinate
Z Z coordinate

Member Data Documentation

template<typename T>
T sf::Vector3< T >::x

X coordinate of the vector.

Definition at line 60 of file Vector3.hpp.

template<typename T>
T sf::Vector3< T >::y

Y coordinate of the vector.

Definition at line 61 of file Vector3.hpp.

template<typename T>
T sf::Vector3< T >::z

Z coordinate of the vector.

Definition at line 62 of file Vector3.hpp.


The documentation for this class was generated from the following file: