Rise
The Vieneo Province
Loading...
Searching...
No Matches
ClientMath.h File Reference
#include <DirectXMath.h>
#include <DirectXPackedVector.h>
#include <cmath>
#include <cstdint>
#include <cstring>
Include dependency graph for ClientMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RiseMath::Vector2
struct  RiseMath::Vector3
struct  RiseMath::Vector4
struct  RiseMath::Quaternion
struct  RiseMath::Plane
struct  RiseMath::Color
struct  RiseMath::Matrix

Namespaces

namespace  RiseMath

Macros

#define RISE_VECTOR_OPERATORS(Type, Count, First)

Typedefs

using RiseMath::Half = DirectX::PackedVector::HALF

Functions

template<class T>
auto RiseMath::ToRadian (T value)
template<class T>
auto RiseMath::ToDegree (T value)
template<class A, class B>
constexpr auto RiseMath::Min (A first, B second)
template<class A, class B>
constexpr auto RiseMath::Max (A first, B second)
float RiseMath::Vec2Length (const Vector2 *a)
float RiseMath::Vec3Dot (const Vector3 *a, const Vector3 *b)
float RiseMath::Vec3LengthSq (const Vector3 *a)
float RiseMath::Vec3Length (const Vector3 *a)
Vector3 * RiseMath::Vec3Add (Vector3 *out, const Vector3 *a, const Vector3 *b)
Vector3 * RiseMath::Vec3Subtract (Vector3 *out, const Vector3 *a, const Vector3 *b)
Vector3 * RiseMath::Vec3Scale (Vector3 *out, const Vector3 *a, float scale)
Vector3 * RiseMath::Vec3Lerp (Vector3 *out, const Vector3 *a, const Vector3 *b, float t)
Vector3 * RiseMath::Vec3BaryCentric (Vector3 *out, const Vector3 *a, const Vector3 *b, const Vector3 *c, float u, float v)
Vector2 * RiseMath::Vec2Normalize (Vector2 *out, const Vector2 *a)
Vector3 * RiseMath::Vec3Normalize (Vector3 *out, const Vector3 *a)
Vector3 * RiseMath::Vec3Cross (Vector3 *out, const Vector3 *a, const Vector3 *b)
Vector3 * RiseMath::Vec3TransformNormal (Vector3 *out, const Vector3 *a, const Matrix *m)
Vector3 * RiseMath::Vec3TransformCoord (Vector3 *out, const Vector3 *a, const Matrix *m)
Vector2 * RiseMath::Vec2TransformCoord (Vector2 *out, const Vector2 *a, const Matrix *m)
Vector4 * RiseMath::Vec3Transform (Vector4 *out, const Vector3 *a, const Matrix *m)
Matrix * RiseMath::MatrixIdentity (Matrix *out)
Matrix * RiseMath::MatrixMultiply (Matrix *out, const Matrix *a, const Matrix *b)
Matrix * RiseMath::MatrixTranspose (Matrix *out, const Matrix *a)
Matrix * RiseMath::MatrixInverse (Matrix *out, float *determinant, const Matrix *a)
Matrix * RiseMath::MatrixScaling (Matrix *out, float x, float y, float z)
Matrix * RiseMath::MatrixTranslation (Matrix *out, float x, float y, float z)
Matrix * RiseMath::MatrixRotationX (Matrix *out, float value)
Matrix * RiseMath::MatrixRotationY (Matrix *out, float value)
Matrix * RiseMath::MatrixRotationZ (Matrix *out, float value)
Matrix * RiseMath::MatrixRotationAxis (Matrix *out, const Vector3 *axis, float angle)
Matrix * RiseMath::MatrixRotationQuaternion (Matrix *out, const Quaternion *q)
Matrix * RiseMath::MatrixRotationYawPitchRoll (Matrix *out, float yaw, float pitch, float roll)
Matrix * RiseMath::MatrixLookAtLH (Matrix *out, const Vector3 *eye, const Vector3 *at, const Vector3 *up)
Matrix * RiseMath::MatrixLookAtRH (Matrix *out, const Vector3 *eye, const Vector3 *at, const Vector3 *up)
Matrix * RiseMath::MatrixPerspectiveRH (Matrix *out, float width, float height, float nearZ, float farZ)
Matrix * RiseMath::MatrixPerspectiveFovRH (Matrix *out, float fov, float aspect, float nearZ, float farZ)
Matrix * RiseMath::MatrixTransformation2D (Matrix *out, const Vector2 *scalingCenter, float scalingRotation, const Vector2 *scaling, const Vector2 *rotationCenter, float rotation, const Vector2 *translation)
Quaternion * RiseMath::QuaternionIdentity (Quaternion *out)
Quaternion * RiseMath::QuaternionNormalize (Quaternion *out, const Quaternion *q)
float RiseMath::QuaternionLength (const Quaternion *q)
Quaternion * RiseMath::QuaternionMultiply (Quaternion *out, const Quaternion *a, const Quaternion *b)
Quaternion * RiseMath::QuaternionRotationYawPitchRoll (Quaternion *out, float yaw, float pitch, float roll)
Quaternion * RiseMath::QuaternionSlerp (Quaternion *out, const Quaternion *a, const Quaternion *b, float t)
Color * RiseMath::ColorLerp (Color *out, const Color *a, const Color *b, float t)
Color * RiseMath::ColorScale (Color *out, const Color *a, float scale)
Plane * RiseMath::PlaneFromPoints (Plane *out, const Vector3 *a, const Vector3 *b, const Vector3 *c)
Plane * RiseMath::PlaneNormalize (Plane *out, const Plane *a)
Plane * RiseMath::PlaneTransform (Plane *out, const Plane *a, const Matrix *matrix)
Vector3 * RiseMath::PlaneIntersectLine (Vector3 *out, const Plane *plane, const Vector3 *first, const Vector3 *second)
bool RiseMath::IntersectTri (const Vector3 *a, const Vector3 *b, const Vector3 *c, const Vector3 *origin, const Vector3 *direction, float *u, float *v, float *distance)
template<class Viewport>
Vector3 * RiseMath::Vec3Project (Vector3 *out, const Vector3 *value, const Viewport *viewport, const Matrix *projection, const Matrix *view, const Matrix *world)
Half * RiseMath::Float32To16Array (Half *out, const float *source, unsigned count)

Variables

constexpr float RiseMath::Pi =3.141592654f
constexpr float RiseMath::HalfPi =1.570796327f
constexpr float RiseMath::Tau =6.283185307f

Macro Definition Documentation

◆ RISE_VECTOR_OPERATORS

#define RISE_VECTOR_OPERATORS ( Type,
Count,
First )
Value:
operator float*(){return &First;} operator const float*() const{return &First;} \
Type& operator+=(const Type& other){for(unsigned i=0;i<Count;++i)(&First)[i]+=static_cast<const float*>(other)[i];return *this;} \
Type& operator-=(const Type& other){for(unsigned i=0;i<Count;++i)(&First)[i]-=static_cast<const float*>(other)[i];return *this;} \
Type& operator*=(float s){for(unsigned i=0;i<Count;++i)(&First)[i]*=s;return *this;} \
Type& operator/=(float s){return *this*=1.f/s;} \
Type operator+() const{return *this;} Type operator-() const{auto result=*this;return result*=-1;} \
friend Type operator+(Type a,const Type& b){return a+=b;} friend Type operator-(Type a,const Type& b){return a-=b;} \
friend Type operator*(Type a,float b){return a*=b;} friend Type operator*(float a,Type b){return b*=a;} \
friend Type operator/(Type a,float b){return a/=b;} \
bool operator==(const Type& other) const{for(unsigned i=0;i<Count;++i)if((&First)[i]!=static_cast<const float*>(other)[i])return false;return true;} \
bool operator!=(const Type& other) const{return !(*this==other);}
Vec operator*(Vec a, double b)
Definition OrbitMath.h:14
Vec operator-(Vec a, Vec b)
Definition OrbitMath.h:13
Vec operator+(Vec a, Vec b)
Definition OrbitMath.h:12
Vec operator/(Vec a, double b)
Definition OrbitMath.h:15
Vector & operator+=(Vector &a, const Vector &b)
Definition Math11.h:13
Vector & operator-=(Vector &a, const Vector &b)
Definition Math11.h:14

Definition at line 18 of file ClientMath.h.