nCine 2025.06.r503-24a4688
A cross-platform 2D game engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ncine::Vector3< T > Class Template Reference

A three component vector based on templates. More...

#include <Vector3.h>

Collaboration diagram for ncine::Vector3< T >:
Collaboration graph
[legend]

Public Member Functions

 Vector3 (T s)
 
 Vector3 (T xx, T yy, T zz)
 
 Vector3 (const Vector3 &other)
 
 Vector3 (const Vector2< T > &other, T zz)
 
Vector3operator= (const Vector3 &other)
 
void set (T xx, T yy, T zz)
 
T * data ()
 
const T * data () const
 
T & operator[] (unsigned int index)
 
const T & operator[] (unsigned int index) const
 
bool operator== (const Vector3 &v) const
 
bool operator!= (const Vector3 &v) const
 
Vector3 operator- () const
 
Vector3operator+= (const Vector3 &v)
 
Vector3operator-= (const Vector3 &v)
 
Vector3operator*= (const Vector3 &v)
 
Vector3operator/= (const Vector3 &v)
 
Vector3operator+= (T s)
 
Vector3operator-= (T s)
 
Vector3operator*= (T s)
 
Vector3operator/= (T s)
 
Vector3 operator+ (const Vector3 &v) const
 
Vector3 operator- (const Vector3 &v) const
 
Vector3 operator* (const Vector3 &v) const
 
Vector3 operator/ (const Vector3 &v) const
 
Vector3 operator+ (T s) const
 
Vector3 operator- (T s) const
 
Vector3 operator* (T s) const
 
Vector3 operator/ (T s) const
 
length () const
 
sqrLength () const
 
Vector3 normalized () const
 
Vector3normalize ()
 
Vector2< T > toVector2 () const
 
template<class S >
Vector3< T > convertType (const Vector3< S > &other)
 

Static Public Member Functions

template<class S >
static Vector3 convertType (const Vector3< S > &other)
 

Public Attributes

x
 
y
 
z
 

Static Public Attributes

static const Vector3 Zero
 A vector with all zero elements.
 
static const Vector3 XAxis
 A unit vector on the X axis.
 
static const Vector3 YAxis
 A unit vector on the Y axis.
 
static const Vector3 ZAxis
 A unit vector on the Z axis.
 

Friends

template<class S >
Vector3< S > operator* (S s, const Vector3< S > &v)
 
template<class S >
dot (const Vector3< S > &v1, const Vector3< S > &v2)
 
template<class S >
Vector3< S > cross (const Vector3< S > &v1, const Vector3< S > &v2)
 

Detailed Description

template<class T>
class ncine::Vector3< T >

A three component vector based on templates.


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