Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
STK::Vector3< Type > Class Template Reference

#include <StkVector3.h>

Public Member Functions

constexpr Vector3 (const Type x, const Type y, const Type z)
 
constexpr Vector3 (const Vector2< Type > &v, Type z=0)
 
template<typename U , STK::enable_if_safe_cast_t< U, Type > = true>
constexpr Vector3 (const Vector3< U > &v)
 
template<typename U >
constexpr operator Vector3< U > () const
 
constexpr const Type & x () const
 
constexpr const Type & y () const
 
constexpr const Type & z () const
 
constexpr ranges::span< const Type, 3 > data () const
 
constexpr Type & x ()
 
constexpr Type & y ()
 
constexpr Type & z ()
 
constexpr ranges::span< Type, 3 > data ()
 
constexpr void setX (Type x)
 
constexpr void setY (Type y)
 
constexpr void setZ (Type z)
 
constexpr bool fuzzyCompare (const Vector3 &v, Type eps) const
 
constexpr void setValues (const Type &x, const Type &y, const Type &z)
 
constexpr void setValues (ranges::span< const Type, 3 > v)
 
constexpr void getValues (const ranges::span< Type, 3 > v) const
 
constexpr void scale (const Type s)
 
constexpr void add (const Vector3 &t)
 
constexpr Type lengthSquared () const
 Length squared.
 
constexpr Type length () const
 
constexpr Vector3normalize ()
 Normalization.
 
constexpr Vector3operator+= (const Vector3 &v)
 Addition.
 
constexpr Vector3operator-= (const Vector3 &v)
 Subtraction.
 
constexpr Vector3 operator- () const
 Unary negation.
 
constexpr Vector3operator*= (Type v)
 Scalar multiplication.
 
constexpr Vector3operator/= (Type v)
 Scalar division.
 

Static Public Member Functions

static constexpr Type angle (const Vector3 &v1, const Vector3 &v2)
 Computing angle between two vectors.
 
static constexpr Type dot (const Vector3 &v1, const Vector3 &v2)
 Computing dot product.
 
static constexpr Vector3 cross (const Vector3 &v1, const Vector3 &v2)
 Creating a vector from cross product.
 
static constexpr int orientation (const Vector3 &p1, const Vector3 &p2, const Vector3 &p3, double eps=1e-6)
 

Static Public Attributes

static constexpr std::size_t vector_size = 3
 

Protected Attributes

std::array< Type, 3 > data_ { 0, 0, 0 }
 

Friends

constexpr friend bool operator== (const Vector3 &t1, const Vector3 &t2)
 
constexpr friend bool operator!= (const Vector3 &t1, const Vector3 &t2)
 
std::ostream & operator<< (std::ostream &os, const Vector3 &t)
 
constexpr Vector3 operator+ (const Vector3 &v1, const Vector3 &v2)
 Addition.
 
constexpr Vector3 operator- (const Vector3 &v1, const Vector3 &v2)
 Subtraction.
 
constexpr Vector3 operator* (const Vector3 &v, Type s)
 Scalar multiplication.
 
constexpr Vector3 operator* (Type s, const Vector3 &v)
 
constexpr Vector3 operator/ (const Vector3 &v, Type s)
 Scalar division.
 

Detailed Description

template<class Type>
class STK::Vector3< Type >

Vector3 - Generic 3D Vector.

Member Function Documentation

◆ orientation()

template<class Type >
static constexpr int STK::Vector3< Type >::orientation ( const Vector3< Type > &  p1,
const Vector3< Type > &  p2,
const Vector3< Type > &  p3,
double  eps = 1e-6 
)
inlinestaticconstexpr

Get orientation (clockwise or counterclockwise) of three points in the XY-plane. Returns the orientation (clockwise or counterclockwise) of the given three points.

counterclockwise = 1, colinear = 0, clockwise = -1


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