#include <vec3.h>
A 3D vector.
Internally represented as a __m128 for performance and alignment reasons.
- See also
- Math::vector
-
Math::point
- Copyright
- (C) 2020 Individual contributors, see AUTHORS file
Inherited by Game::AngularVelocity, Game::Position, Game::Scale, and Game::Velocity.
|
| vec3 ()=default |
| default constructor, NOTE: does NOT setup components!
|
|
| vec3 (scalar x, scalar y, scalar z) |
| construct from values
|
|
| vec3 (scalar v) |
| construct from single value
|
|
| vec3 (const vec3 &rhs)=default |
| copy constructor
|
|
| vec3 (const __m128 &rhs) |
| construct from SSE 128 byte float array
|
|
void | operator= (const __m128 &rhs) |
| assign an vmVector4
|
|
void | operator+= (const vec3 &rhs) |
| inplace add
|
|
void | operator-= (const vec3 &rhs) |
| inplace sub
|
|
void | operator*= (scalar s) |
| inplace scalar multiply
|
|
void | operator*= (const vec3 &rhs) |
| muliply by a vector component-wise
|
|
void | operator/= (const vec3 &rhs) |
| divide by a vector component-wise
|
|
bool | operator== (const vec3 &rhs) const |
| equality operator
|
|
bool | operator!= (const vec3 &rhs) const |
| inequality operator
|
|
void | load (const scalar *ptr) |
| load content from 16-byte-aligned memory
|
|
void | loadu (const scalar *ptr) |
| load content from unaligned memory
|
|
void | store (scalar *ptr) const |
| write content to 16-byte-aligned memory through the write cache
|
|
void | storeu (scalar *ptr) const |
| write content to unaligned memory through the write cache
|
|
void | stream (scalar *ptr) const |
| stream content to 16-byte-aligned memory circumventing the write-cache
|
|
void | set (scalar x, scalar y, scalar z) |
| set content
|
|
scalar & | operator[] (const int index) |
| read-only access to indexed component
|
|
scalar | operator[] (const int index) const |
| read-only access to indexed component
|
|
|
union { | |
|
struct { | |
|
float x | |
|
float y | |
|
float z | |
|
float __w | |
|
} | | |
|
__m128 vec | |
|
float v [3] | |
|
}; | | |
|
◆ vec3() [1/5]
default constructor, NOTE: does NOT setup components!
◆ vec3() [2/5]
◆ vec3() [3/5]
__forceinline Math::vec3::vec3 |
( |
scalar | v | ) |
|
|
explicit |
construct from single value
◆ vec3() [4/5]
Math::vec3::vec3 |
( |
const vec3 & | rhs | ) |
|
|
default |
◆ vec3() [5/5]
__forceinline Math::vec3::vec3 |
( |
const __m128 & | rhs | ) |
|
construct from SSE 128 byte float array
◆ load()
__forceinline void Math::vec3::load |
( |
const scalar * | ptr | ) |
|
load content from 16-byte-aligned memory
Load 4 floats from 16-byte-aligned memory.
◆ loadu()
__forceinline void Math::vec3::loadu |
( |
const scalar * | ptr | ) |
|
load content from unaligned memory
Load 4 floats from unaligned memory.
◆ operator!=()
__forceinline bool Math::vec3::operator!= |
( |
const vec3 & | rhs | ) |
const |
◆ operator*=() [1/2]
__forceinline void Math::vec3::operator*= |
( |
const vec3 & | rhs | ) |
|
muliply by a vector component-wise
◆ operator*=() [2/2]
__forceinline void Math::vec3::operator*= |
( |
scalar | s | ) |
|
◆ operator+=()
__forceinline void Math::vec3::operator+= |
( |
const vec3 & | rhs | ) |
|
◆ operator-=()
__forceinline void Math::vec3::operator-= |
( |
const vec3 & | rhs | ) |
|
◆ operator/=()
__forceinline void Math::vec3::operator/= |
( |
const vec3 & | rhs | ) |
|
divide by a vector component-wise
◆ operator=()
__forceinline void Math::vec3::operator= |
( |
const __m128 & | rhs | ) |
|
◆ operator==()
__forceinline bool Math::vec3::operator== |
( |
const vec3 & | rhs | ) |
const |
◆ operator[]() [1/2]
__forceinline scalar & Math::vec3::operator[] |
( |
const int | index | ) |
|
read-only access to indexed component
◆ operator[]() [2/2]
__forceinline scalar Math::vec3::operator[] |
( |
const int | index | ) |
const |
read-only access to indexed component
◆ set()
◆ store()
__forceinline void Math::vec3::store |
( |
scalar * | ptr | ) |
const |
write content to 16-byte-aligned memory through the write cache
Store to 16-byte-aligned float pointer.
◆ storeu()
__forceinline void Math::vec3::storeu |
( |
scalar * | ptr | ) |
const |
write content to unaligned memory through the write cache
Store to non-aligned float pointer.
◆ stream()
__forceinline void Math::vec3::stream |
( |
scalar * | ptr | ) |
const |
stream content to 16-byte-aligned memory circumventing the write-cache
◆ [union]
◆ __w
◆ vec
The documentation for this struct was generated from the following file:
- /github/workspace/code/foundation/math/vec3.h