Epok Engine

PSYQO SDK

psyqo::SoftMath::normOfVec3

Function · 2 overloads

Function

Computes the norm of a 3D vector.

Belongs to
psyqo::SoftMath
Header
soft-math.hh
Overloads
2

Declaration 1 of 2

Declaration
FixedPoint<> normOfVec3(const Vec3 &v)

Computes the norm of a 3D vector.

ParameterTypeMeaning
vconst Vec3 &The vector.

Returns: FixedPoint<> — psyqo::FixedPoint<> The norm.

Example

C++ example
#include "psyqo/soft-math.hh"

// Assume these named values have been initialized with valid data:
// const Vec3 & v

auto result = psyqo::SoftMath::normOfVec3(v);

Why use it

Fixed-point inputs keep console behavior deterministic and avoid software floating-point work.

Trade-offs and warnings

Stay within the documented range and account for quantization before chaining several operations. Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/soft-math.hh:218

Declaration 2 of 2

static
Declaration
static inline FixedPoint<> normOfVec3(const Vec3 *v)

Performs `norm of vec3` as part of the soft math module.

ParameterTypeMeaning
vconst Vec3 *Value supplied for v. Keep referenced or pointed-to data valid for the complete call.

Returns: FixedPoint<>. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "psyqo/soft-math.hh"

// Assume these named values have been initialized with valid data:
// const Vec3 * v

auto result = psyqo::SoftMath::normOfVec3(v);

Why use it

Fixed-point inputs keep console behavior deterministic and avoid software floating-point work.

Trade-offs and warnings

Stay within the documented range and account for quantization before chaining several operations. Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/soft-math.hh:219

Related members