ParticleAPI 3.0.0 Performant particle system API in C++ for interactive graphics

Public Member Functions | Friends | List of all members
pVec Class Reference

A single-precision floating point three-vector. More...

`#include <pVec.h>`

## Public Member Functions
| pVec (float ax, float ay, float az)
| pVec (float a)
| pVec ()=default
| pVec (float *v)
const float & | x () const
const float & | y () const
const float & | z () const
float & | x ()
float & | y ()
float & | z ()
float | length () const
float | lenSqr () const
float | normalize (const float toLen=1.f)
pVec | operator* (const float s) const
pVec | operator/ (const float s) const
pVec | operator+ (const pVec &a) const
pVec | operator- (const pVec &a) const
bool | operator== (const pVec &a) const
pVec | operator- ()
pVec & | operator+= (const pVec &a)
pVec & | operator-= (const pVec &a)
pVec & | operator*= (const float a)
pVec & | operator/= (const float a)
bool | isNan ()

## Friends
float | dot (const pVec &a, const pVec &b)
pVec | Abs (const pVec &a)
pVec | CompMult (const pVec &a, const pVec &b)
pVec | Cross (const pVec &a, const pVec &b)
std::ostream & | operator<< (std::ostream &os, const pVec &v)

## Detailed Description

A single-precision floating point three-vector.

This class is used for packaging three floats for the application to pass into the API.

This is also the class used internally to do vector math.

## Constructor & Destructor Documentation

## ◆ pVec() [1/4]

pVec | ( | float | ax,
|  | float | ay,
|  | float | az
| ) |  |
| inline

## ◆ pVec() [2/4]

pVec | ( | float | a | ) |
| inline

## ◆ pVec() [3/4]

pVec | ( |  | ) |
| inlinedefault

## ◆ pVec() [4/4]

pVec | ( | float * | v | ) |
| inline

## Member Function Documentation

## ◆ isNan()

bool isNan | ( |  | ) |
| inline

## ◆ length()

float length | ( |  | ) | const
| inline

## ◆ lenSqr()

float lenSqr | ( |  | ) | const
| inline

## ◆ normalize()

float normalize | ( | const float | toLen = `1.f` | ) |
| inline

## ◆ operator*()

pVec operator* | ( | const float | s | ) | const
| inline

## ◆ operator*=()

pVec & operator*= | ( | const float | a | ) |
| inline

## ◆ operator+()

pVec operator+ | ( | const pVec & | a | ) | const
| inline

## ◆ operator+=()

pVec & operator+= | ( | const pVec & | a | ) |
| inline

## ◆ operator-() [1/2]

pVec operator- | ( |  | ) |
| inline

## ◆ operator-() [2/2]

pVec operator- | ( | const pVec & | a | ) | const
| inline

## ◆ operator-=()

pVec & operator-= | ( | const pVec & | a | ) |
| inline

## ◆ operator/()

pVec operator/ | ( | const float | s | ) | const
| inline

## ◆ operator/=()

pVec & operator/= | ( | const float | a | ) |
| inline

## ◆ operator==()

bool operator== | ( | const pVec & | a | ) | const
| inline

## ◆ x() [1/2]

float & x | ( |  | ) |
| inline

## ◆ x() [2/2]

const float & x | ( |  | ) | const
| inline

## ◆ y() [1/2]

float & y | ( |  | ) |
| inline

## ◆ y() [2/2]

const float & y | ( |  | ) | const
| inline

## ◆ z() [1/2]

float & z | ( |  | ) |
| inline

## ◆ z() [2/2]

const float & z | ( |  | ) | const
| inline

## Friends And Related Function Documentation

## ◆ Abs

pVec Abs | ( | const pVec & | a | ) |
| friend

## ◆ CompMult

pVec CompMult | ( | const pVec & | a,
|  | const pVec & | b
| ) |  |
| friend

## ◆ Cross

pVec Cross | ( | const pVec & | a,
|  | const pVec & | b
| ) |  |
| friend

## ◆ dot

float dot | ( | const pVec & | a,
|  | const pVec & | b
| ) |  |
| friend

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const pVec & | v
| ) |  |
| friend

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

- pVec.h