Math

Sony VectorMath library wrapper.

Typedefs

Type

Description

typedef math::Matrix3

A type definition for a 3×3 matrix based on VectorMath::Matrix3.

typedef math::Matrix4

A type definition for a 4×4 matrix based on VectorMath::Matrix4.

typedef math::Point2

A type definition for a 2 component point based on VectorMath::Point2.

typedef math::Point3

A type definition for a 3 component point based on VectorMath::Point3.

typedef math::Vector2

A type definition for a 2 component vector based on VectorMath::Vector2.

typedef math::Vector3

A type definition for a 3 component vector based on VectorMath::Vector3.

typedef math::Vector4

A type definition for a 4 component vector based on VectorMath::Vector4.

Functions

Return type

Description

Vec4

cauldron::PolarToVector (float yaw, float pitch)
Converts polar rotation to a vector representation.

const Mat4

cauldron::Perspective ( float fovyRadians, float aspect, float zNear, float zFar, bool invertedDepth )
Construct a perspective projection matrix with an inverted depth argument.

const Mat4

cauldron::Orthographic ( float left, float right, float bottom, float top, float zNear, float zFar, bool invertedDepth )
Construct an orthographic projection matrix with z in range [0, 1].

Mat4

cauldron::InverseMatrix (const Mat4 & srcMatrix)
Returns the inverse of a matrix.

Mat3

cauldron::InverseMatrix (const Mat3 & srcMatrix)
Returns the inverse of a matrix.

Mat4

Construct a matrix positioned at ‘eye’ and rotated to face ‘lookAt’.

Mat4

cauldron::TransposeMatrix (const Mat4 & srcMatrix)
Returns the transpose of a matrix.

Vec4

cauldron::MinPerElement (const Vec4 & vec1, const Vec4 & vec2)
Returns a vector composed of per-element minimums.

Vec4

cauldron::MaxPerElement (const Vec4 & vec1, const Vec4 & vec2)
Returns a vector composed of per-element maximums.

Detailed description

Sony VectorMath library wrapper.

Typedefs

Mat3

Copied!

typedef math::Matrix3 Mat3

A type definition for a 3×3 matrix based on VectorMath::Matrix3.


Mat4

Copied!

typedef math::Matrix4 Mat4

A type definition for a 4×4 matrix based on VectorMath::Matrix4.


Point2

Copied!

typedef math::Point2 Point2

A type definition for a 2 component point based on VectorMath::Point2.


Point3

Copied!

typedef math::Point3 Point3

A type definition for a 3 component point based on VectorMath::Point3.


Vec2

Copied!

typedef math::Vector2 Vec2

A type definition for a 2 component vector based on VectorMath::Vector2.


Vec3

Copied!

typedef math::Vector3 Vec3

A type definition for a 3 component vector based on VectorMath::Vector3.


Vec4

Copied!

typedef math::Vector4 Vec4

A type definition for a 4 component vector based on VectorMath::Vector4.


Global functions

PolarToVector

Copied!

Vec4  cauldron::PolarToVector (float yaw, float pitch)

Converts polar rotation to a vector representation.

Parameters:

yaw

Yaw angle (in radians).

pitch

Pitch angle (in radians).

Returns:

Vec4 representation of the polar rotation.


Perspective

Copied!

const Mat4  cauldron::Perspective (
    float fovyRadians,
    float aspect,
    float zNear,
    float zFar,
    bool invertedDepth
)

Construct a perspective projection matrix with an inverted depth argument.

Parameters:

fovyRadians

FOV (in radians).

aspect

Aspect ratio.

zNear

Near plane.

zFar

Far plane.

invertedDepth

True if using inverted infinite depth.

Returns:

Mat4 perspective matrix.


Orthographic

Copied!

const Mat4  cauldron::Orthographic (
    float left,
    float right,
    float bottom,
    float top,
    float zNear,
    float zFar,
    bool invertedDepth
)

Construct an orthographic projection matrix with z in range [0, 1].

Parameters:

left

Left plane.

right

Right plane.

bottom

Bottom plane.

top

Top plane.

zNear

Near plane.

zFar

Far plane.

invertedDepth

True if using inverted infinite depth.

Returns:

Mat4 orthographic matrix.


InverseMatrix

Copied!

Mat4  cauldron::InverseMatrix (const Mat4 & srcMatrix)

Returns the inverse of a matrix.

Parameters:

srcMatrix

The matrix to inverse.

Returns:

Mat4 inverted matrix.


InverseMatrix

Copied!

Mat3  cauldron::InverseMatrix (const Mat3 & srcMatrix)

Returns the inverse of a matrix.

Parameters:

srcMatrix

The matrix to inverse.

Returns:

Mat3 inverted matrix.


LookAtMatrix

Copied!

Mat4  cauldron::LookAtMatrix (Vec4  eye, Vec4  lookAt, Vec4  up)

Construct a matrix positioned at ‘eye’ and rotated to face ‘lookAt’.

Parameters:

eye

Source (translation).

lookAt

Look at (direction).

up

Up vector to orient the matrix properly.

Returns:

Mat4 matrix.


TransposeMatrix

Copied!

Mat4  cauldron::TransposeMatrix (const Mat4 & srcMatrix)

Returns the transpose of a matrix.

Parameters:

srcMatrix

The matrix to transpose.

Returns:

Mat4 transposed matrix.


MinPerElement

Copied!

Vec4  cauldron::MinPerElement (const Vec4 & vec1, const Vec4 & vec2)

Returns a vector composed of per-element minimums.

Parameters:

vec1

Vector1.

vec2

Vector2.

Returns:

Vec4 the 4-component vector of minimums per element.


MaxPerElement

Copied!

Vec4  cauldron::MaxPerElement (const Vec4 & vec1, const Vec4 & vec2)

Returns a vector composed of per-element maximums.

Parameters:

vec1

Vector1.

vec2

Vector2.

Returns:

Vec4 the 4-component vector of maximums per element.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!