cPy.cTypes module

Contents

cPy.cTypes module#

class cStr(Src: str)[source]#

Bases: object

A custom string class optimized for performance and ease of use. *
This class provides a wide range of string manipulation functions, including
dynamic resizing, formatting, path handling, and type conversions.
It is designed to work with standard C-style strings and provides
safe memory management.
ToCharPtr() str[source]#
Returns a pointer to the internal character buffer.
Returns:

A const char pointer to the string data. Returns a pointer to an empty string if null.

Return type:

str

ToNonConstCharPtr() str[source]#
Length() int[source]#
rief Gets the length of the string.
SetLength(Length: int, Fill: any)[source]#
Ensures needed capacity and sets a specified length.
Parameters:
  • Length (int) – The new length of the string.

  • Fill – The character to fill new space with if expanding.

CalcLength()[source]#
Recalculates the length based on the actual null terminator position.
Useful after direct buffer manipulation via ToCharPtr().
Fill(c: any)[source]#
rief Fills the entire string with a specified character.
IsEmpty() bool[source]#
rief Checks if the string is empty.
empty() bool[source]#
rief Checks if the string length is 0 (STL compatibility).
Clear()[source]#
rief Clears the string content (sets length to 0).
Empty: cStr#
brief A static constant representing an empty string.
static Equals(l: cStr, r: cStr) bool[source]#
static EqualsNoCase(l: cStr, r: cStr, MaxLength: int) bool[source]#
static Compare(l: cStr, r: cStr, MaxLength: int) int[source]#
static CompareNoCase(l: cStr, r: cStr, MaxLength: int) int[source]#
static EqualsPath(l: cStr, r: cStr, MaxLength: int) bool[source]#
static ComparePath(l: cStr, r: cStr, MaxLength: int) int[source]#
StartsWith(Str: str, NoCase: bool = False) bool[source]#
Determines whether the beginning of this instance matches the specified string.
Parameters:
  • Str (str) – The string to compare.

  • NoCase (bool) – If true, ignores case.

Returns:

True if it starts with Str or if Str is empty.

Return type:

bool

EndsWith(Str: str, NoCase: bool = False) bool[source]#
Determines whether the end of this instance matches the specified string.
Parameters:
  • Str (str) – The string to compare.

  • NoCase (bool) – If true, ignores case.

Returns:

True if it ends with Str or if Str is empty.

Return type:

bool

static ToString(DoubleArray: float, Count: int, Prec: int = 6, Separator: str = ' ') cStr[source]#
static ToHex(Ptr: any) cStr[source]#
rief Converts pointer address to hex string.
AppendWithEndLn(Src: cStr)[source]#
rief Appends a string followed by a newline.
EndLn: cStr#
brief Static newline constant.
AppendPath(Path: str)[source]#
rief Appends a path segment, automatically adding a slash or backslash.
Insert(Index: int, Src: float, Prec: int = 6)[source]#
Remove(StartIndex: int, Count: int)[source]#
Deletes a specific number of characters.
Parameters:
  • StartIndex (int) – Position to start removing.

  • Count (int) – Number of characters to remove.

ReplaceCommaWithDot()[source]#
rief Utility to replace commas with dots (e.g. for localization fixing).
Replace(String: str, WithString: str, StartIndex: int, Count: int, NoCase: bool = False) int[source]#
ReplaceFirst(String: str, WithString: str, StartIndex: int, Count: int, NoCase: bool = False) int[source]#
ReplaceAny(Chars: str, WithChar: any, StartIndex: int, Count: int)[source]#
Substring(StartIndex: int, Count: int) cStr[source]#
rief Retrieves a substring of specified length.
TrimStart(TrimChars: str)[source]#
rief Removes specified characters from the start of the string.
TrimEnd(TrimChars: str)[source]#
rief Removes specified characters from the end of the string.
Trim(TrimChars: str)[source]#
rief Removes specified characters from both start and end.
PadLeft(TotalWidth: int, PaddingChar: any)[source]#
rief Right-aligns characters, padding on the left.
PadRight(TotalWidth: int, PaddingChar: any)[source]#
rief Left-aligns characters, padding on the right.
Contains(Str: str, NoCase: bool = False) bool[source]#
rief Checks if the string contains a substring.
IndexOf(c: any) int[source]#
rief Returns the index of the first occurrence of a character, or -1.
IndexOfAny(Chars: str, StartIndex: int, Count: int) int[source]#
LastIndexOf(Str: str, StartIndex: int, Count: int, NoCase: bool = False) int[source]#
LastIndexOfAny(Chars: str, StartIndex: int, Count: int) int[source]#
static ToLower(c: any) any[source]#
rief Static helper to convert char to lower case.
static ToUpper(c: any) any[source]#
rief Static helper to convert char to upper case.
MakeLower(start: int = 0)[source]#
rief Converts this string instance to lowercase in place.
MakeUpper(start: int = 0)[source]#
rief Converts this string instance to uppercase in place.
static Formatv(Format: str, Args: any) cStr[source]#
Creates a formatted string (printf style).
Parameters:

Format (str) – The format string.

Returns:

A new formatted cStr.

Return type:

cStr

static CharIsLower(c: int) bool[source]#
rief Helper: Is character lowercase?
static CharIsUpper(c: int) bool[source]#
rief Helper: Is character uppercase?
static CharIsAlpha(c: int) bool[source]#
rief Helper: Is character alphabetical?
static CharIsNumeric(c: int) bool[source]#
rief Helper: Is character a digit?
static CharIsHexadecimal(c: int) bool[source]#
rief Helper: Is character hexadecimal digit?
static CharIsNewLine(c: int) bool[source]#
rief Helper: Is character a newline type?
static CharIsTab(c: int) bool[source]#
rief Helper: Is character a tab?
static CharIsWhitespace(c: int) bool[source]#
rief Helper: Is character whitespace?
static CharIsDecimalPoint(c: int) bool[source]#
rief Helper: Is character a decimal point (. or ,)?
static CharIsSign(c: int) bool[source]#
rief Helper: Is character a sign (+ or -)?
static CharIsExponent(c: int) bool[source]#
rief Helper: Is character part of exponent notation (e, E, d, D)?
static ToInt(Str: str, Value: int) bool[source]#
rief Parses string to integer.
static ToFloat(Str: str, Value: float) bool[source]#
rief Parses string to float.
GetHashCode(NoCase: bool = False) int[source]#
rief Calculates a hash code for the string.
GetFileExtension() cStr[source]#
rief Extracts file extension from path.
GetFileName() cStr[source]#
rief Extracts file name (with extension) from path.
GetFileBase() cStr[source]#
rief Extracts file base name (no path, no extension).
GetFilePath() cStr[source]#
rief Extracts directory path (excluding filename).
RemoveFileExtension()[source]#
rief Removes extension from the string (in place).
RemoveFileName()[source]#
rief Removes filename, leaving only path (in place).
RemoveFilePath()[source]#
rief Removes path, leaving only filename (in place).
RemoveFileAbsPath(AbsPath: str)[source]#
rief Removes absolute path prefix if present.
AppendFileRelPath(RelPath: str)[source]#
rief Appends a relative path correctly.
SetFileExtension(Extension: str)[source]#
rief Sets or replaces file extension.
SetFileDefaultExtension(DefaultExtension: str)[source]#
rief Sets extension only if none exists.
SetFilePath(Path: str)[source]#
rief Sets or replaces the directory path.
SetFileDefaultPath(DefaultPath: str)[source]#
rief Sets path only if none exists.
EnsureTrailingBackslash()[source]#
rief Ensures string ends with a backslash.
EnsureTrailingSlash()[source]#
rief Ensures string ends with a forward slash.
EnsureTrailingPlatformSlash()[source]#
rief Ensures trailing slash based on current platform (Windows/Linux/Mac).
SlashesToBackSlashes()[source]#
BackSlashesToSlashes()[source]#
rief Converts all backslashes to forward slashes.
MakePlatformSlashes()[source]#
rief Normalizes slashes based on current platform.
CalcUTF8Length(StartIndex: int) int[source]#
Init()[source]#
rief Resets internal state to empty.
Free()[source]#
rief Frees memory and resets state.
Copy(_0: any)[source]#
toWstring() any[source]#
Append(_0: any)[source]#
class cVec2(v: cVec2)[source]#

Bases: object

A 2D vector class providing linear algebra operations and geometry functions. *
This class represents a 2-component vector (x, y) and includes methods for
arithmetic, geometric transformations (dot, cross, normalize), matrix multiplication,
and various utility functions (lerp, clamp, reflect). *
Refer to it as coat::vec2 in the Core API.
x: float#
The X component of the vector.
y: float#
The Y component of the vector.
Copy(Src: float)[source]#
SetZero()[source]#
Sets the vector to (0, 0).
SetOne()[source]#
Sets the vector to (1, 1).
Set(X: float, Y: float)[source]#
Sets components to specific X and Y values.
Transform(_0: any)[source]#
Transforms the vector by a 3x3 matrix.
Treats the vector as a direction (x, y, 0).
TransformCoordinate(_0: any)[source]#
Transforms the vector by a 4x4 matrix treating it as a point.
Implicitly extends to (x, y, 0, 1) and projects the result back
by dividing by w (Perspective divide).
TransformNormal(_0: any)[source]#
Transforms the vector by a 4x4 matrix treating it as a normal/direction.
Implicitly extends to (x, y, 0, 0), ignoring translation.
static Equals(_0: cVec2, _1: cVec2, Eps: float) bool[source]#
Checks if two vectors are equal within a given epsilon tolerance.
Length() float[source]#
Returns the length (magnitude) of the vector.
LengthSq() float[source]#
Returns the squared length of the vector (faster than Length).
Normalize() float[source]#
Normalizes the vector in place. Returns the previous length.
NormalizeSafe(Fallback: cVec2) float[source]#
Normalizes the vector safely.
Parameters:

Fallback (cVec2) – The value to assign if the vector length is zero.

Returns:

The previous length, or 0.0f if the vector was zero.

Return type:

float

IsValid() bool[source]#
Checks if the vector components are valid numbers (not NaN/Inf).
IsNormalized(Eps: float) bool[source]#
Checks if the vector is normalized (length == 1) within tolerance.
IsZero(Eps: float) bool[source]#
Checks if the vector is zero (length == 0) within tolerance.
static Round(_0: cVec2) cVec2[source]#
Returns a new vector with components rounded to the nearest integer.
ToRound() cVec2[source]#
Returns a new vector with this vector’s components rounded.
static Abs(_0: cVec2) cVec2[source]#
Returns a vector containing the absolute values of the components.
static Fract(_0: cVec2) cVec2[source]#
Returns the fractional part of the components.
static Angle(_0: cVec2, _1: cVec2) float[source]#
Returns the angle in degrees between two vectors.
static AreaSigned(t0: cVec2, t1: cVec2, t2: cVec2) float[source]#
Returns the signed area of the triangle formed by t0, t1, t2.
static Ccw(_0: cVec2, _1: cVec2) float[source]#
“Counter-Clockwise” or 2D Cross Product.
Returns:

The magnitude of the Z component of the cross product (u.x*v.y - u.y*v.x).

Return type:

float

static Clamp(Value: cVec2, Lo: cVec2, Hi: cVec2) cVec2[source]#
Clamps a vector between a Low and High range (component-wise).
static Distance(_0: cVec2, _1: cVec2) float[source]#
Calculates the distance between two vectors.
static DistanceSq(_0: cVec2, _1: cVec2) float[source]#
Calculates the squared distance between two vectors.
static Dot(_0: cVec2, _1: cVec2) float[source]#
Calculates the Dot Product of two vectors.
static Lerp(_0: cVec2, _1: cVec2, _2: float) cVec2[source]#
Linearly interpolates between two vectors.
static Lerp05(_0: cVec2, _1: cVec2) cVec2[source]#
Linearly interpolates between two vectors with factor 0.5.
static Max(_0: cVec2, _1: cVec2) cVec2[source]#
Returns the component-wise maximum of two vectors.
static Min(_0: cVec2, _1: cVec2) cVec2[source]#
Returns the component-wise minimum of two vectors.
static PerpCw(_0: cVec2) cVec2[source]#
Returns a vector perpendicular to u (Clockwise rotation 90 deg).
static PerpCcw(_0: cVec2) cVec2[source]#
Returns a vector perpendicular to u (Counter-Clockwise rotation 90 deg).
static Reflect(RayDir: cVec2, Normal: cVec2) cVec2[source]#
Reflects a ray direction off a surface normal.
static Refract(RayDir: cVec2, Normal: cVec2, Eta: float) cVec2[source]#
Refracts a ray direction through a surface normal with index of refraction Eta.
static Truncate(u: cVec2, MaxLength: float) cVec2[source]#
Truncates the vector length to MaxLength. Returns a new vector.
static RandRange1() cVec2[source]#
Returns a random vector with components in range [0, 1].
static RandNormal() cVec2[source]#
Returns a random normalized vector.
static Rand(Lo: cVec2, Hi: cVec2) cVec2[source]#
Returns a random vector between Lo and Hi.
distance2(_0: cVec2) float[source]#
Python-style distance squared.
distance(_0: cVec2) float[source]#
Python-style distance.
DistanceToLineSegSq(A: cVec2, B: cVec2, pScale: float = None) float[source]#
Squared distance from this point to a line segment AB.
static SegIntersection(L0: cVec2, L1: cVec2, R0: cVec2, R1: cVec2, l: float = None, r: float = None) bool[source]#
Calculates the intersection of two line segments.
static FromBaryCentric(t0: cVec2, t1: cVec2, t2: cVec2, u: float, v: float) cVec2[source]#
Calculates a position from Barycentric coordinates (u, v) on a triangle.
static FromPolar(Radius: float, Angle: float) cVec2[source]#
Creates a vector from Polar coordinates (Radius, Angle in degrees).
Zero: cVec2 = 0.0000 0.0000#
One: cVec2 = 1.0000 1.0000#
Infinity: cVec2 = 340282346638528859811704183484516925440.0000 340282346638528859811704183484516925440.0000#
AxisX: cVec2 = 1.0000 0.0000#
AxisY: cVec2 = 0.0000 1.0000#
AxisNegX: cVec2 = -1.0000 0.0000#
AxisNegY: cVec2 = 0.0000 -1.0000#
GetDimension() int[source]#
Returns the number of dimensions (2).
ToFloatPtr() float[source]#
Returns a pointer to the raw float data.
ToPolar(Radius: float, Angle: float)[source]#
Converts Cartesian coordinates to Polar (Radius, Angle).
ToBaryCentric(t0: cVec2, t1: cVec2, t2: cVec2, u: float, v: float) float[source]#
Calculates Barycentric coordinates of this point within triangle t0,t1,t2.
IsInsideTri(t0: cVec2, t1: cVec2, t2: cVec2) bool[source]#
Checks if this point lies inside the triangle t0,t1,t2.
ToString(Prec: int = 2) cStr[source]#
Converts the vector to a formatted string.
ToNormal() cVec2[source]#
Returns a normalized copy of this vector.
ToPerpCw() cVec2[source]#
Returns a copy rotated 90 degrees Clockwise.
ToPerpCcw() cVec2[source]#
Returns a copy rotated 90 degrees Counter-Clockwise.
AddWithWeight(src: cVec2, weight: float)[source]#
for compatibility with OpenSubdiv ////
SetPosition(aX: float, aY: float)[source]#
GetPosition() float[source]#
class cVec3(v: cVec3)[source]#

Bases: object

The 3D-vector, refer it as coat::vec3 in the Core API.
  • This class represents a 3-dimensional vector with float precision components (x, y, z).

It includes standard vector arithmetic, geometric operations, and transformation utilities.
x: float#
X component of the vector
y: float#
Y component of the vector
z: float#
Z component of the vector
Copy(Src: float)[source]#
SetZero()[source]#
Sets the vector to (0, 0, 0).
SetOne()[source]#
Sets the vector to (1, 1, 1).
SetRandRange1()[source]#
Sets components to random values in the range [0, 1].
Set(XY: cVec2, Z: float)[source]#
Sets components from a 2D vector and a Z value.
TransformCoordinate(_0: any)[source]#
Transforms the vector as a coordinate (position) using a 4x4 matrix.
TransformNormal(_0: any)[source]#
Transforms the vector as a normal using a 4x4 matrix.
TransformNormalTransposed(_0: any)[source]#
Transforms the vector as a normal using the transpose of a 4x4 matrix.
Transform(_0: any)[source]#
Transforms the vector using a 3x3 matrix.
Rotate(_0: any)[source]#
Rotates the vector using a rotation object.
distance(u: cVec3) float[source]#
Calculates the Euclidean distance to another vector.
distanceSq(u: cVec3) float[source]#
dot(u: cVec3) float[source]#
cross(u: cVec3, v: cVec3)[source]#
AddWithWeight(src: cVec3, weight: float)[source]#
Adds a weighted vector to this vector.
SetPosition(aX: float, aY: float, aZ: float)[source]#
GetPosition() float[source]#
static Equals(_0: cVec3, _1: cVec3, Eps: float) bool[source]#
Checks if two vectors are equal within a given epsilon tolerance.
Length() float[source]#
Returns the length (magnitude) of the vector.
Length2() float[source]#
Returns the length using fast sqrt approximation.
LengthSq() float[source]#
Returns the squared length of the vector.
LengthM() float[source]#
Returns the Manhattan distance (sum of absolute components).
Normalize() float[source]#
Normalizes the vector. Returns the original length.
Normalize2() float[source]#
Normalizes the vector using fast sqrt. Returns the squared length.
NormalizeSafe(Fallback: cVec3 = cVec3.AxisZ) float[source]#
Safely normalizes the vector. If length is zero, uses the Fallback vector.
FixDegenerateNormal() bool[source]#
Fixes degenerate normal vectors (NaN or zero length). Returns true if fixed.
FixDenormals() bool[source]#
Fixes denormalized floating point numbers in the vector.
IsValid() bool[source]#
Checks if the vector contains valid numbers (not NaN or Inf).
IsNormalized(Eps: float) bool[source]#
Checks if the vector is normalized (length is approximately 1).
IsZero(Eps: float) bool[source]#
Checks if the vector is approximately zero.
Round()[source]#
Rounds components to the nearest integer.
static Abs(_0: cVec3) cVec3[source]#
Returns a vector with absolute values of the components.
static Angle(p1: cVec3, p2: cVec3, p3: cVec3, normal: cVec3) float[source]#
Returns the signed angle between (p1-p2) and (p3-p2) around a normal.
static AreaSigned(t0: cVec3, t1: cVec3, t2: cVec3) float[source]#
Returns the area of the triangle formed by t0, t1, t2.
static BaryCentric(t0: cVec3, t1: cVec3, t2: cVec3, f: float, g: float) cVec3[source]#
Computes a point using barycentric coordinates (f, g).
static Clamp(_0: cVec3, _1: cVec3, _2: cVec3) cVec3[source]#
Clamps a vector between a min and max vector (component-wise).
static Cross(_0: cVec3, _1: cVec3) cVec3[source]#
Computes the cross product of two vectors (static).
SetCross(_0: cVec3, _1: cVec3)[source]#
Computes the cross product of two vectors and sets the result to this.
static Distance(_0: cVec3, _1: cVec3) float[source]#
Computes the distance between two vectors.
static Distance2(_0: cVec3, _1: cVec3) float[source]#
Computes the distance between two vectors using fast sqrt.
static DistanceSq(_0: cVec3, _1: cVec3) float[source]#
Computes the squared distance between two vectors.
static Dot(_0: cVec3, _1: cVec3) float[source]#
Computes the dot product of two vectors.
static Lerp(_0: cVec3, _1: cVec3, _2: float) cVec3[source]#
Linearly interpolates between two vectors.
static Lerp05(_0: cVec3, _1: cVec3) cVec3[source]#
Linearly interpolates between two vectors with factor 0.5.
static Max(_0: cVec3, _1: cVec3) cVec3[source]#
Returns the component-wise maximum of two vectors.
static Min(_0: cVec3, _1: cVec3) cVec3[source]#
Returns the component-wise minimum of two vectors.
static Reflect(RayDir: cVec3, Normal: cVec3) cVec3[source]#
Reflects a ray direction off a surface with the given normal.
static Refract(RayDir: cVec3, Normal: cVec3, Eta: float) cVec3[source]#
Refracts a ray direction.
Parameters:

Eta (float) – Ratio of indices of refraction at the surface interface.

static Slerp(n0: cVec3, n1: cVec3, s: float) cVec3[source]#
Spherical linear interpolation between two vectors.
static Truncate(u: cVec3, MaxLen: float) cVec3[source]#
Truncates the vector u so its length does not exceed MaxLen.
static RandRange1() cVec3[source]#
Returns a vector with random components in range [0, 1].
static RandNormal() cVec3[source]#
Returns a random normalized vector.
static Rand(Lo: cVec3, Hi: cVec3) cVec3[source]#
Returns a vector with random components in the range [Lo, Hi].
static Project(v1: cVec3, v2: cVec3) cVec3[source]#
Projects vector v1 onto vector v2.
static Perpendicular(v1: cVec3) cVec3[source]#
Returns a vector perpendicular to v1 (arbitrary axis).
TriProjectionSolidAngle(a: cVec3, b: cVec3, c: cVec3) float[source]#
Calculates the solid angle of the triangle (a, b, c) as seen from this point.
Zero: cVec3 = 0.0000 0.0000 0.0000#
Constants
One: cVec3 = 1.0000 1.0000 1.0000#
< (0, 0, 0)
Infinity: cVec3 = 340282346638528859811704183484516925440.0000 340282346638528859811704183484516925440.0000 340282346638528859811704183484516925440.0000#
< (1, 1, 1)
AxisX: cVec3 = 1.0000 0.0000 0.0000#
< (Inf, Inf, Inf)
AxisY: cVec3 = 0.0000 1.0000 0.0000#
< (1, 0, 0)
AxisZ: cVec3 = 0.0000 0.0000 1.0000#
< (0, 1, 0)
AxisNegX: cVec3 = -1.0000 0.0000 0.0000#
< (0, 0, 1)
AxisNegY: cVec3 = 0.0000 -1.0000 0.0000#
< (-1, 0, 0)
AxisNegZ: cVec3 = 0.0000 0.0000 -1.0000#
< (0, -1, 0)
GetDimension() int[source]#
Returns the dimension of the vector (3).
ToFloatPtr() float[source]#
Returns a pointer to the float data.
ToVec2() cVec2[source]#
Casts to a reference of a 2D vector (xy).
ToString(Prec: int = 2) cStr[source]#
Converts the vector to a formatted string.
ToAngles() any[source]#
Converts the vector to Euler angles (Pitch, Yaw, Roll).
GetOrthonormal() cVec3[source]#
Returns an arbitrary vector orthonormal to this one.
GetOrthonormalPair() list[source]#
Returns a pair of vectors orthonormal to this one and each other (forming a basis).
MakeOrthonormalTo(vec: cVec3)[source]#
Makes this vector orthonormal to the given vector.
ToPolarXZ(Radius: float, Angle: float)[source]#
Converts to Polar coordinates in the XZ plane.
static FromPolarXZ(Radius: float, Angle: float) cVec3[source]#
Creates a vector from Polar coordinates in the XZ plane.
ToBaryCentric(t0: cVec3, t1: cVec3, t2: cVec3, f: float, g: float) float[source]#
Computes barycentric coordinates (f, g) of this point relative to triangle (t0, t1, t2).
ToNormal() cVec3[source]#
Returns a normalized copy of this vector.
ToPerps(X: cVec3, Y: cVec3)[source]#
Computes two perpendicular vectors (X, Y) to this vector.
ToPerp() cVec3[source]#
Returns a single perpendicular vector.
static RayTri(RayOrig: cVec3, RayDir: cVec3, t0: cVec3, t1: cVec3, t2: cVec3, u: float, v: float, t: float, BackFaceCull: bool = False) bool[source]#
Ray-Triangle intersection test.
static PointInTriangle(p: cVec3, t0: cVec3, t1: cVec3, t2: cVec3) bool[source]#
Checks if a point p lies within triangle (t0, t1, t2).
class cVec4(v: cVec4)[source]#

Bases: object

A 4-component vector class (x, y, z, w).
  • This class represents a 4D vector, often used for homogeneous coordinates in 3D graphics,

colors (RGBA), or generic 4-value mathematical operations.
Refer to it as coat::vec4 in the Core API.
x: float#
X component of the vector.
y: float#
Y component of the vector.
z: float#
Z component of the vector.
w: float#
W component of the vector.
SetZero()[source]#
Set(XYZ: cVec3, W: float)[source]#
Sets components from a 3D vector and a scalar.
Parameters:
  • XYZ (cVec3) – The vector containing x, y, and z.

  • W (float) – The w component.

Copy(pSrc: float)[source]#
Copies components from a raw float array.
Parameters:

pSrc (float) – Pointer to an array of at least 4 floats.

Transform(mat: any)[source]#
Transforms this vector by a 4x4 matrix.
Parameters:

mat – The matrix to transform by.

static Equals(u: cVec4, v: cVec4, Eps: float) bool[source]#
Checks if two vectors are equal within a tolerance.
Parameters:
  • u (cVec4) – First vector.

  • v (cVec4) – Second vector.

  • Eps (float) – Epsilon tolerance.

Length() float[source]#
Calculates the length (magnitude) of the vector.
LengthSq() float[source]#
Calculates the squared length of the vector (faster than Length).
Normalize() float[source]#
Normalizes the vector to unit length.
Returns:

The original length of the vector.

Return type:

float

NormalizeSafe(Fallback: cVec4 = cVec4.AxisW) float[source]#
Safely normalizes the vector. If length is close to zero, sets to Fallback.
Parameters:

Fallback (cVec4) – The vector to use if this vector is zero-length.

Returns:

The original length.

Return type:

float

IsNormalized(Eps: float) bool[source]#
Checks if the vector is normalized (length is ~1).
IsZero(Eps: float) bool[source]#
Checks if the vector is zero (all components ~0).
static Abs(_0: cVec4) cVec4[source]#
Returns a vector containing the absolute values of the input components.
static Dot(_0: cVec4, _1: cVec4) float[source]#
Calculates the dot product of two vectors.
static Lerp(u: cVec4, v: cVec4, s: float) cVec4[source]#
Linear interpolation between two vectors.
Parameters:
  • u (cVec4) – Start vector.

  • v (cVec4) – End vector.

  • s (float) – Interpolation factor (0.0 to 1.0).

Returns:

Interpolated vector.

Return type:

cVec4

static Max(_0: cVec4, _1: cVec4) cVec4[source]#
Returns a vector containing the maximum components of two vectors.
static Min(_0: cVec4, _1: cVec4) cVec4[source]#
Returns a vector containing the minimum components of two vectors.
Zero: cVec4 = 0.0000 0.0000 0.0000 0.0000#
One: cVec4 = 1.0000 1.0000 1.0000 1.0000#
< (0, 0, 0, 0)
Infinity: cVec4 = 340282346638528859811704183484516925440.0000 340282346638528859811704183484516925440.0000 340282346638528859811704183484516925440.0000 340282346638528859811704183484516925440.0000#
< (1, 1, 1, 1)
AxisX: cVec4 = 1.0000 0.0000 0.0000 0.0000#
< (Inf, Inf, Inf, Inf)
AxisY: cVec4 = 0.0000 1.0000 0.0000 0.0000#
< (1, 0, 0, 0)
AxisZ: cVec4 = 0.0000 0.0000 1.0000 0.0000#
< (0, 1, 0, 0)
AxisW: cVec4 = 0.0000 0.0000 0.0000 1.0000#
< (0, 0, 1, 0)
AxisNegX: cVec4 = -1.0000 0.0000 0.0000 0.0000#
< (0, 0, 0, 1)
AxisNegY: cVec4 = 0.0000 -1.0000 0.0000 0.0000#
< (-1, 0, 0, 0)
AxisNegZ: cVec4 = 0.0000 0.0000 -1.0000 0.0000#
< (0, -1, 0, 0)
AxisNegW: cVec4 = 0.0000 0.0000 0.0000 -1.0000#
< (0, 0, -1, 0)
ToFloatPtr() float[source]#
Returns a pointer to the raw float data.
ToVec2() cVec2[source]#
Casts this vector to a cVec2 (x, y).
ToVec3() cVec3[source]#
Casts this vector to a cVec3 (x, y, z).
GetDimension() int[source]#
Returns the number of dimensions (4).
ToString(Prec: int = 2) cStr[source]#
Converts the vector to a formatted string.
AddWithWeight(src: cVec4, weight: float)[source]#
Clears the vector (sets all to 0). OpenSubdiv compat.
SetPosition(aX: float, aY: float, aZ: float, aW: float)[source]#
GetPosition() float[source]#
class cMat3(v: cMat3)[source]#

Bases: object

Represents a 3x3 Matrix.
  • Used for 3D linear algebra transformations, primarily rotation and scaling.

  • Stored in row-major order (array of 3 rows).

  • Supports interaction with cVec3, cQuat, and cAngles.

Copy(Float9: float)[source]#
CopyTransposed(Float9: float)[source]#
Copies 9 floats into the matrix treating input as Column-Major (Transposes).
SetZero()[source]#
Sets all elements to zero.
SetIdentity()[source]#
Sets the matrix to Identity (diagonal 1.0, others 0.0).
GetRow(Index: int) cVec3[source]#
Returns the specified row as a vector (0, 1, or 2).
GetRow0() cVec3[source]#
GetRow1() cVec3[source]#
GetRow2() cVec3[source]#
Row(Index: int) cVec3[source]#
Returns a mutable reference to the specified row.
Row0() cVec3[source]#
Row1() cVec3[source]#
Row2() cVec3[source]#
SetRow(Index: int, X: float, Y: float, Z: float)[source]#
Sets the values of a specific row using floats.
SetRow0(X: float, Y: float, Z: float)[source]#
SetRow1(X: float, Y: float, Z: float)[source]#
SetRow2(X: float, Y: float, Z: float)[source]#
GetCol(Index: int) cVec3[source]#
Constructs and returns a vector representing the specified column.
GetCol0() cVec3[source]#
GetCol1() cVec3[source]#
GetCol2() cVec3[source]#
SetCol(Index: int, X: float, Y: float, Z: float)[source]#
Sets the values of a specific column using floats.
SetCol0(X: float, Y: float, Z: float)[source]#
SetCol1(X: float, Y: float, Z: float)[source]#
SetCol2(X: float, Y: float, Z: float)[source]#
SetElem(Row: int, Col: int, Value: float)[source]#
Sets a specific element at (Row, Col).
GetElem(Row: int, Col: int) float[source]#
Returns the value at (Row, Col).
Elem(Row: int, Col: int) float[source]#
Returns a mutable reference to the element at (Row, Col).
Trace() float[source]#
Calculates the sum of the diagonal elements.
Determinant() float[source]#
Calculates the determinant of the matrix.
static Equals(_0: cMat3, _1: cMat3, Eps: float) bool[source]#
Checks equality with a tolerance (Epsilon).
IsZero(Eps: float) bool[source]#
Checks if all elements are zero (within Eps).
IsIdentity(Eps: float) bool[source]#
Checks if the matrix is Identity (within Eps).
IsSymmetric(Eps: float) bool[source]#
Checks if the matrix is symmetric (Matrix == Transpose).
IsOrthonormal(Eps: float) bool[source]#
Checks if rows are orthogonal and unit length (Pure rotation matrix).
Add(R: cMat3)[source]#
Adds matrix R to this matrix.
Sub(R: cMat3)[source]#
Subtracts matrix R from this matrix.
Mul(s: float)[source]#
Multiplies all elements by scalar s.
Zero: cMat3 = 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000#
Zero matrix constant.
Identity: cMat3 = 1.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 1.0000#
Identity matrix constant.
static Transpose(_0: cMat3) cMat3[source]#
Returns the transpose of matrix M (swaps rows and columns).
static Invert(Fm: cMat3, To: cMat3) bool[source]#
Calculates the inverse of matrix Fm.
Parameters:
  • Fm (cMat3) – Source matrix.

  • To (cMat3) – Pointer to destination matrix.

Returns:

True if successful, False if determinant is too small (singular).

Return type:

bool

static OrthoNormalize(Src: cMat3) cMat3[source]#
Inverts this matrix in place. Returns false if singular.
static Rotation(Axis: cVec3, Angle: float) cMat3[source]#
Creates a rotation matrix around an arbitrary axis.
static RotationX(Angle: float) cMat3[source]#
Creates a rotation matrix around the X axis.
static RotationY(Angle: float) cMat3[source]#
Creates a rotation matrix around the Y axis.
static RotationZ(Angle: float) cMat3[source]#
Creates a rotation matrix around the Z axis.
static RotationXYZ(Pitch: float, Yaw: float, Roll: float) cMat3[source]#
Creates a rotation matrix from Euler angles (Pitch, Yaw, Roll).
static EulerZYX(eulerX: float, eulerY: float, eulerZ: float) cMat3[source]#
Creates a rotation matrix using ZYX order.
static Scaling(XYZ: cVec3) cMat3[source]#
Creates a scaling matrix from a 3D vector.
ToFloatPtr() float[source]#
Returns mutable pointer to raw data.
ToMat4() any[source]#
Converts to a 4x4 matrix (puts this in top-left, Identity elsewhere).
ToQuat() any[source]#
Converts rotation matrix to Quaternion.
ToVectors(Forward: cVec3, Right: cVec3 = None, Up: cVec3 = None)[source]#
Extracts basis vectors (Forward, Right, Up) from the matrix.
Typically assumes rows contain the basis vectors.
static FromVectors(Forward: cVec3, Right: cVec3, Up: cVec3) cMat3[source]#
Constructs a matrix from basis vectors.
static FromForward(Forward: cVec3) cMat3[source]#
Constructs a rotation matrix looking in ‘Forward’ direction.
ToForward() cVec3[source]#
Extracts the Forward vector (Row 0).
ToRight() cVec3[source]#
Extracts the Right vector (Row 1).
ToUp() cVec3[source]#
Extracts the Up vector (Row 2).
ToAngles() any[source]#
Converts rotation matrix to Euler angles.
class cMat4(v: cMat4)[source]#

Bases: object

A 4x4 Matrix class designed for 3D graphics and linear algebra. *
This class uses row-major storage (cVec4 m_Rows[4]).
It supports row-vector multiplication conventions (v’ = v * M).
Translation data is typically stored in the 4th row (Index 3). *
ote Refer to it as coat::mat4 in the Core API.
Copy(Float16: float)[source]#
CopyTransposed(Float16: float)[source]#
Copies data from a float array and transposes it.
SetZero()[source]#
Sets all elements to zero.
SetIdentity()[source]#
Sets the matrix to the identity matrix.
GetRow(Index: int) cVec4[source]#
GetRow0() cVec4[source]#
GetRow1() cVec4[source]#
GetRow2() cVec4[source]#
GetRow3() cVec4[source]#
Row(Index: int) cVec4[source]#
Row0() cVec4[source]#
Row1() cVec4[source]#
Row2() cVec4[source]#
Row3() cVec4[source]#
SetRow(Index: int, X: float, Y: float, Z: float, W: float)[source]#
SetRow0(X: float, Y: float, Z: float, W: float)[source]#
SetRow1(X: float, Y: float, Z: float, W: float)[source]#
SetRow2(X: float, Y: float, Z: float, W: float)[source]#
SetRow3(X: float, Y: float, Z: float, W: float)[source]#
GetCol(Index: int) cVec4[source]#
GetCol0() cVec4[source]#
GetCol1() cVec4[source]#
GetCol2() cVec4[source]#
GetCol3() cVec4[source]#
SetCol(Index: int, X: float, Y: float, Z: float, W: float)[source]#
SetCol0(X: float, Y: float, Z: float, W: float)[source]#
SetCol1(X: float, Y: float, Z: float, W: float)[source]#
SetCol2(X: float, Y: float, Z: float, W: float)[source]#
SetCol3(X: float, Y: float, Z: float, W: float)[source]#
SetElem(Row: int, Col: int, Value: float)[source]#
GetElem(Row: int, Col: int) float[source]#
Elem(Row: int, Col: int) float[source]#
Trace() float[source]#
Calculates the trace (sum of diagonal elements).
Determinant() float[source]#
Calculates the determinant of the matrix.
static Equals(_0: cMat4, _1: cMat4, Eps: float) bool[source]#
Checks equality with another matrix within a tolerance epsilon.
IsZero(Eps: float) bool[source]#
Checks if this is a zero matrix.
IsIdentity(Eps: float) bool[source]#
Checks if this is an identity matrix.
IsSymmetric(Eps: float) bool[source]#
Checks if the matrix is symmetric (M == M^T).
IsOrthonormal(Eps: float) bool[source]#
Checks if the matrix is orthonormal (Determinant is 1).
Add(R: cMat4)[source]#
In-place arithmetic operations
Sub(R: cMat4)[source]#
Mul(s: float)[source]#
ToFloatPtr() float[source]#
ToString(Prec: int = 2) cStr[source]#
Converts the matrix to a formatted string.
ToMat3() cMat3[source]#
Extracts the upper-left 3x3 matrix.
ToNormalMatrix() cMat3[source]#
Extracts the normal matrix (usually inverse transpose of upper 3x3).
ToQuat() any[source]#
Converts the rotation component to a Quaternion.
GetTranslation() cVec3[source]#
SetTranslation(_0: cVec3)[source]#
GetScaling() cVec3[source]#
SetScaling(_0: cVec3)[source]#
GetRotation() any[source]#
SetRotation(_0: any)[source]#
static Transpose(_0: cMat4) cMat4[source]#
Returns the transpose of matrix M.
static Invert(Fm: cMat4, To: cMat4) bool[source]#
Calculates the inverse of Fm and stores it in To. Returns false if singular.
Zero: cMat4 = 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000#
Inverts this matrix in-place. Returns false if singular.
Identity: cMat4 = 1.0000 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 0.0000 1.0000#
static Translation(XYZ: cVec3) cMat4[source]#
static Rotation(Axis: cVec3, Angle: float) cMat4[source]#
static RotationX(Angle: float) cMat4[source]#
static RotationY(Angle: float) cMat4[source]#
static RotationZ(Angle: float) cMat4[source]#
static RotationXYZ(Pitch: float, Yaw: float, Roll: float) cMat4[source]#
static EulerZYX(eulerX: float, eulerY: float, eulerZ: float) cMat4[source]#
static RotationAt(Orig: cVec3, Axis: cVec3, Angle: float) cMat4[source]#
static Scaling(XYZ: cVec3) cMat4[source]#
static ScalingAt(Orig: cVec3, Dir: cVec3, Scale: float) cMat4[source]#
static Perspective(YFov: float, AspectWtoH: float, Znear: float, Zfar: float) cMat4[source]#
Creates a perspective projection matrix.
static PerspectiveInf(YFov: float, AspectWtoH: float, Znear: float) cMat4[source]#
Creates an infinite perspective projection matrix (Zfar at infinity).
static Ortho(B: any) cMat4[source]#
static CubeViewProjection(Pos: cVec3, Side: int, Radius: float, GL: bool) cMat4[source]#
Creates a view-projection matrix for a specific side of a cube map.
static LookAtViewProjection(LookFrom: cVec3, LookAt: cVec3, FovY: float, AspectYtoH: float, Znear: float, Zfar: float) cMat4[source]#
Creates a LookAt view matrix.
class cRect(v: cRect)[source]#

Bases: object

Represents an axis-aligned 2D rectangle defined by Min and Max points.
  • Coordinate system note: This class typically assumes a standard mathematical

coordinate system where Y increases upwards (Top > Bottom), based on the implementation
of AlignTop/Bottom.
static Equals(_0: cRect, _1: cRect, Eps: float) bool[source]#
Checks if two rectangles are equal within a tolerance epsilon.
Parameters:

Eps (float) – Tolerance for floating point comparison.

Set(Min: cVec2, Max: cVec2)[source]#
Sets the rectangle coordinates using vectors.
x() float[source]#
y() float[source]#
width() float[source]#
height() float[source]#
SetLeft(Left: float)[source]#
AlignLeft(X: float)[source]#
SetTop(Top: float)[source]#
Sets the top edge position (resizes height).
AlignTop(Y: float)[source]#
SetRight(Right: float)[source]#
Sets the right edge position (resizes width).
AlignRight(X: float)[source]#
SetBottom(Bottom: float)[source]#
Sets the bottom edge position (resizes height).
AlignBottom(Y: float)[source]#
AlignInside(Parent: cRect)[source]#
Successively aligns right, bottom, left, and top edges to keep this rectangle inside the parent.
GetTopLeft() cVec2[source]#
TopLeft
SetTopLeft(TopLeft: cVec2)[source]#
AlignTopLeft(TopLeft: cVec2)[source]#
GetTopCenter() cVec2[source]#
AlignTopCenter(TopCenter: cVec2)[source]#
GetTopRight() cVec2[source]#
SetTopRight(TopRight: cVec2)[source]#
AlignTopRight(TopRight: cVec2)[source]#
GetMiddleLeft() cVec2[source]#
AlignMiddleLeft(MiddleLeft: cVec2)[source]#
GetMiddleCenter() cVec2[source]#
AlignMiddleCenter(MiddleCenter: cVec2)[source]#
GetMiddleRight() cVec2[source]#
AlignMiddleRight(MiddleRight: cVec2)[source]#
GetBottomLeft() cVec2[source]#
SetBottomLeft(BottomLeft: cVec2)[source]#
AlignBottomLeft(BottomLeft: cVec2)[source]#
GetBottomCenter() cVec2[source]#
AlignBottomCenter(BottomCenter: cVec2)[source]#
GetBottomRight() cVec2[source]#
SetBottomRight(BottomRight: cVec2)[source]#
AlignBottomRight(BottomRight: cVec2)[source]#
GetPoint(Align: int) cVec2[source]#
AlignPoint(Align: int, Parent: cRect)[source]#
GetDockingAlign(Child: cVec2, DockingRegion: cRect = None, RelPos: cVec2 = None) int[source]#
GetDockingRegion(Child: cVec2, Align: int) cRect[source]#
GetLeft() float[source]#
GetTop() float[source]#
GetRight() float[source]#
GetBottom() float[source]#
GetWidth() float[source]#
GetHeight() float[source]#
SetWidth(HoldPoint: int, Width: float)[source]#
SetHeight(HoldPoint: int, Height: float)[source]#
Sets the height, resizing relative to a specific hold point (cAlign).
GetSize() cVec2[source]#
SetSize(HoldPoint: int, Side: float)[source]#
GetCenterX() float[source]#
GetCenterY() float[source]#
AlignCenterX(X: float)[source]#
AlignCenterY(Y: float)[source]#
Moves the rectangle vertically to center at Y.
Inflate(Delta: cVec2)[source]#
SetToPoint(P: cVec2)[source]#
ProjectPoint(_0: cVec2) cVec2[source]#
AddPoint(P: cVec2) bool[source]#
AddRect(Rc: cRect) bool[source]#
Translate(Delta: cVec2)[source]#
Contains(Rc: cRect) bool[source]#
static Union(l: cRect, r: cRect) cRect[source]#
Returns the smallest rectangle containing both inputs.
static Intersect(l: cRect, r: cRect) cRect[source]#
Returns the overlapping area of two rectangles.
IntersectsWith(Rc: cRect) bool[source]#
Checks if this rectangle overlaps with Rc.
Transform(T: cMat4)[source]#
Applies a 3D transform (projecting back to w=1) to the rectangle.
ToRound() cRect[source]#
Returns a rectangle with integer coordinates (rounded).
Round()[source]#
Rounds the coordinates of this rectangle in place.
Zero: cRect = cRect object>#
Empty: cRect = cRect object>#
Unit: cRect = cRect object>#
IsEmpty() bool[source]#
Checks if the rectangle is invalid (Min > Max).
SetEmpty()[source]#
SetZero()[source]#
static Inscribe(What: cRect, Where: cRect) cRect[source]#
class cBounds(v: any)[source]#

Bases: object

Represents an Axis-Aligned Bounding Box (AABB) in 3D space.
  • Defined by a minimum point (min x, min y, min z) and a maximum point (max x, max y, max z).

Used for collision detection, visibility testing, and spatial partitioning.
GetMin() cVec3[source]#
Returns a mutable reference to the minimum corner.
GetMax() cVec3[source]#
Returns a mutable reference to the maximum corner.
Set(Min: cVec3, Max: cVec3)[source]#
Sets the bounds using new min and max values.
Parameters:
  • Min (cVec3) – New minimum corner.

  • Max (cVec3) – New maximum corner.

SetMin(_0: cVec3)[source]#
Sets the minimum corner.
SetMax(_0: cVec3)[source]#
Sets the maximum corner.
GetSize() cVec3[source]#
Calculates the size vector (Max - Min).
GetSizeX() float[source]#
Returns the width (X axis size).
GetSizeY() float[source]#
Returns the height (Y axis size).
GetSizeZ() float[source]#
Returns the depth (Z axis size).
GetDiagonal() float[source]#
Calculates the length of the diagonal.
GetCenter() cVec3[source]#
Calculates the center point of the bounds.
GetLargestAxis() int[source]#
Returns the index of the longest axis.
Returns:

0 for X, 1 for Y, 2 for Z.

Return type:

int

GetShortestAxis() int[source]#
Returns the index of the shortest axis.
Returns:

0 for X, 1 for Y, 2 for Z.

Return type:

int

SetEmpty()[source]#
Invalidates the bounds by setting Min to MaxValue and Max to -MaxValue.
SetZero()[source]#
Sets bounds to (0,0,0) -> (0,0,0).
IsEmpty() bool[source]#
Checks if the bounds are empty (invalid or zero volume).
Empty: cBounds = cBounds object>#
Represents an invalid/empty bounding box.
Zero: cBounds = cBounds object>#
Represents a zero-sized bounding box at the origin.
One: cBounds = cBounds object>#
Represents a box from (-1,-1,-1) to (1,1,1).
AddPoint(_0: cVec3) bool[source]#
Expands the bounds to include the given point.
Returns:

True if the bounds were expanded.

Return type:

bool

AddBounds(_0: any) bool[source]#
Expands the bounds to include another bounding box.
Returns:

True if the bounds were expanded.

Return type:

bool

Inflate(Delta: cVec3)[source]#
Translate(_0: cVec3)[source]#
Translates the bounds by a 3D vector.
DistanceToPointSq(p: cVec3) float[source]#
Squared distance from a 3D point to the bounds (0 if inside).
ContainsCircle(Center: cVec2, Radius: float) bool[source]#
Checks if a 2D circle is contained within or overlaps the projected bounds.
ContainsPoint(_0: cVec3) bool[source]#
Checks if a 3D point is inside the bounds.
ContainsBounds(_0: any) bool[source]#
Checks if another bounding box is fully contained within this one.
IntersectsBounds(_0: any) bool[source]#
Checks if this box intersects with another box.
IntersectsSphere(_0: any) bool[source]#
Checks if this box intersects with a sphere.
RayIntersection(RayOrig: cVec3, RayDir: cVec3, Cross: cVec3 = None) bool[source]#
Helper for RayIntersection that returns the intersection point.
Parameters:
  • RayOrig (cVec3) – Ray origin.

  • RayDir (cVec3) – Ray direction.

  • Cross (cVec3) – [Out] Intersection point (optional).

Returns:

True if intersecting.

Return type:

bool

LineIntersection(RayOrig: cVec3, RayDir: cVec3, Scale: float) bool[source]#
class cRotation(Orig: cVec3, Axis: cVec3, Angle: float)[source]#

Bases: object

Represents a rotation defined by an origin (pivot), an axis, and an angle. *
This class handles rotation logic including conversion to matrices, quaternions,
and Euler angles. It includes an internal caching mechanism for the rotation matrix
to optimize repeated access.
Set(Orig: cVec3, Axis: cVec3, Angle: float) cRotation[source]#
Sets new parameters for the rotation.
  • Invalidates the cached matrix.

Parameters:
  • Orig (cVec3) – The new origin.

  • Axis (cVec3) – The new axis.

  • Angle (float) – The new angle.

Returns:

Reference to this cRotation object.

Return type:

cRotation

GetOrig() cVec3[source]#
Gets the origin of the rotation.
Returns:

Const reference to the origin vector.

Return type:

cVec3

GetAxis() cVec3[source]#
Gets the axis of the rotation.
Returns:

Const reference to the axis vector.

Return type:

cVec3

GetAngle() float[source]#
Gets the angle of the rotation.
Returns:

The angle value.

Return type:

float

SetOrig(Orig: cVec3)[source]#
Sets the origin of the rotation.
Parameters:

Orig (cVec3) – The new origin vector.

SetAxis(Axis: cVec3)[source]#
Sets the axis of the rotation.
  • Invalidates the cached matrix.

Parameters:

Axis (cVec3) – The new axis vector.

SetAngle(Angle: float)[source]#
Sets the angle of the rotation.
  • Invalidates the cached matrix.

Parameters:

Angle (float) – The new angle value.

ReCalcMatrix()[source]#
Forces recalculation of the cached rotation matrix.
Normalize180() cRotation[source]#
Normalizes the angle to be within [-180, 180] degrees (or radians equivalent).
Returns:

Reference to this object.

Return type:

cRotation

Normalize360() cRotation[source]#
Normalizes the angle to be within [0, 360] degrees (or radians equivalent).
Returns:

Reference to this object.

Return type:

cRotation

ToAngles() any[source]#
Converts the rotation to Euler angles.
Returns:

A cAngles object representing the rotation.

Return type:

any

ToQuat() any[source]#
Converts the rotation to a Quaternion.
Returns:

A cQuat object representing the rotation.

Return type:

any

ToMat3() cMat3[source]#
Converts the rotation to a 3x3 Matrix.
  • Updates the internal cache if necessary.

Returns:

Const reference to the cMat3 matrix.

Return type:

cMat3

ToMat4() cMat4[source]#
Converts the rotation to a 4x4 Matrix.
Returns:

A cMat4 object.

Return type:

cMat4

ToAngularVelocity() cVec3[source]#
Calculates the angular velocity vector.
Returns:

A cVec3 representing angular velocity.

Return type:

cVec3

class cAngles(Pitch: float, Yaw: float, Roll: float)[source]#

Bases: object

Represents Euler angles for 3D rotations.
  • This class manages rotations using Pitch, Yaw, and Roll components.

Commonly used for object orientation, camera control, and physics calculations.
Pitch: float#
Rotation around the X-axis (Up/Down) in degrees.
Yaw: float#
Rotation around the Y-axis (Left/Right) in degrees.
Roll: float#
Rotation around the Z-axis (Banking/Fall over) in degrees.
Set(Pitch: float, Yaw: float, Roll: float)[source]#
Sets the angles to new values.
Parameters:
  • Pitch (float) – Rotation around X-axis.

  • Yaw (float) – Rotation around Y-axis.

  • Roll (float) – Rotation around Z-axis.

SetZero()[source]#
Resets all angles to zero.
Copy(Src: float)[source]#
Copies values from a float array.
Parameters:

Src (float) – Pointer to an array of at least 3 floats [Pitch, Yaw, Roll].

static Equals(_0: cAngles, _1: cAngles, Eps: float) bool[source]#
Checks if two angles are equal within a given epsilon tolerance.
Parameters:

Eps (float) – Tolerance value (default is cMath::Epsilon).

Returns:

True if components are within Eps of each other.

Return type:

bool

Length() float[source]#
Calculates the length (magnitude) of the angle vector.
Returns:

Square root of sum of squares.

Return type:

float

LengthSq() float[source]#
Calculates the squared length of the angle vector.
Returns:

Sum of squares (Pitch^2 + Yaw^2 + Roll^2).

Return type:

float

Normalize360()[source]#
Normalizes the angles to be within the range [0, 360).
Normalize180()[source]#
Normalizes the angles to be within the range [-180, 180).
Round()[source]#
Rounds each component to the nearest integer.
static Clamp(u: cAngles, Min: cAngles, Max: cAngles) cAngles[source]#
Clamps angle values between a minimum and maximum range.
Parameters:
  • u (cAngles) – The angle to clamp.

  • Min (cAngles) – Minimum values.

  • Max (cAngles) – Maximum values.

Returns:

The clamped cAngles object.

Return type:

cAngles

static Rand(Range: cAngles) cAngles[source]#
Generates random angles within the specified range.
Parameters:

Range (cAngles) – Maximum magnitude for each component.

Returns:

Random angles.

Return type:

cAngles

static Angle(l: cAngles, r: cAngles) float[source]#
Calculates the angular difference between two orientations.
Parameters:
Returns:

Angle in degrees.

Return type:

float

static Distance(l: cAngles, r: cAngles) float[source]#
Calculates the “distance” between two angles (alias for Angle).
Parameters:
Returns:

Angle in degrees.

Return type:

float

Zero: cAngles = cAngles object>#
ToVectors(Forward: cVec3, Right: cVec3 = None, Up: cVec3 = None)[source]#
Converts Euler angles to direction vectors (Forward, Right, Up).
Parameters:
  • Forward (cVec3) – Pointer to store the forward vector.

  • Right (cVec3) – Pointer to store the right vector (optional).

  • Up (cVec3) – Pointer to store the up vector (optional).

ToForward() cVec3[source]#
Converts to a forward direction vector.
ToRight() cVec3[source]#
Converts to a right direction vector.
ToUp() cVec3[source]#
Converts to an up direction vector.
ToMat3() cMat3[source]#
Converts angles to a 3x3 rotation matrix.
ToMat4() cMat4[source]#
Converts angles to a 4x4 rotation matrix.
ToQuat() any[source]#
Converts angles to a Quaternion.
GetDimension() int[source]#
Returns the number of components (3).
ToFloatPtr() float[source]#
Returns a pointer to the raw float data.
ToString(Prec: int = 2) cStr[source]#
Converts the angles to a string representation.
Parameters:

Prec (int) – Decimal precision.

Returns:

String formatted as “Pitch Yaw Roll”.

Return type:

cStr

static EnsureShortestPath(l: cAngles, r: cAngles)[source]#
Modifies angles to ensure the interpolation takes the shortest path.
  • Ensures that the difference between components is within [-180, 180].

Parameters:
static Lerp(l: cAngles, r: cAngles, s: float) cAngles[source]#
Linearly interpolates between two angles.
Parameters:
  • l (cAngles) – Start angle.

  • r (cAngles) – End angle.

  • s (float) – Interpolation factor (0.0 to 1.0).

Returns:

Interpolated angle.

Return type:

cAngles

class cQuat(v: cQuat)[source]#

Bases: object

Header file for the Quaternion class.
  • Implementation of quaternions for 3D rotations and orientation,

including arithmetic operations, interpolation (SLERP, SQUAD),
and conversions to/from matrices and Euler angles.
x: float#
y: float#
< X component of the vector part.
z: float#
< Y component of the vector part.
w: float#
< Z component of the vector part.
SetIdentity()[source]#
SetZero()[source]#
Sets all components to zero.
IsZero(Eps: float) bool[source]#
Checks if the quaternion is zero (within epsilon).
Parameters:

Eps (float) – Tolerance for comparison.

Returns:

true if all components are close to zero.

Return type:

bool

Set(XYZ: cVec3, W: float)[source]#
Sets the components using a vector and a scalar.
static Mul(_0: cQuat, _1: cQuat) cQuat[source]#
Multiplies two quaternions.
  • Represents combining two rotations (q0 applied then q1, depending on convention).

static Div(_0: cQuat, _1: cQuat) cQuat[source]#
Divides two quaternions.
  • Equivalent to q0 * Inverse(q1).

static Equals(_0: cQuat, _1: cQuat, Eps: float) bool[source]#
Checks if two quaternions are equal component-wise.
static EqualRotations(_0: cQuat, _1: cQuat, Eps: float) bool[source]#
Checks if two quaternions represent the same rotation.
  • Considers that q and -q represent the same orientation in 3D space.

static SameHemisphere(_0: cQuat, _1: cQuat) bool[source]#
Checks if two quaternions are in the same hemisphere.
  • Based on the dot product sign.

Compress()[source]#
Compresses the quaternion for storage (e.g., usually for network).
  • Ensures W is positive and then sets it to 0 (assuming reconstruction later).

CalcW()[source]#
Reconstructs W component assuming a unit quaternion.
  • w = sqrt(1 - x^2 - y^2 - z^2).

Length() float[source]#
Returns the magnitude (length) of the quaternion.
LengthSq() float[source]#
Returns the squared magnitude.
Normalize() cQuat[source]#
Normalizes the quaternion to unit length.
Returns:

Reference to this quaternion.

Return type:

cQuat

IsNormalized(Eps: float) bool[source]#
Checks if the quaternion is normalized (length is close to 1).
static Conjugate(_0: cQuat) cQuat[source]#
Returns the conjugate of a quaternion (-x, -y, -z, w).
static Dot(_0: cQuat, _1: cQuat) float[source]#
Calculates the dot product of two quaternions.
static Exp(_0: cQuat) cQuat[source]#
Calculates the exponential map.
static Invert(_0: cQuat) cQuat[source]#
Calculates the inverse of the quaternion.
static Lerp(q0: cQuat, q1: cQuat, s: float, ShortestPath: bool = True) cQuat[source]#
Linear Interpolation between two quaternions.
Parameters:

ShortestPath (bool) – If true, flips signs to ensure shortest rotational path.

static Ln(_0: cQuat) cQuat[source]#
Calculates the natural logarithm map.
static LnDif(_0: cQuat, _1: cQuat) cQuat[source]#
Calculates the difference in log space.
static Slerp(q0: cQuat, q1: cQuat, s: float, ShortestPath: bool = True) cQuat[source]#
Spherical Linear Interpolation (SLERP).
  • Provides constant speed interpolation along the arc.

static Squad(q1: cQuat, A: cQuat, B: cQuat, C: cQuat, s: float) cQuat[source]#
Spherical Quadrangle Interpolation (SQUAD).
  • Used for smooth spline interpolation between quaternions.

static SquadSetup(q0: cQuat, q1: cQuat, q2: cQuat, q3: cQuat, A: cQuat, B: cQuat, C: cQuat)[source]#
Helper function to calculate intermediate control points for SQUAD.
Identity: cQuat = cQuat object>#
Zero: cQuat = cQuat object>#
< Identity Quaternion (0, 0, 0, 1).
GetDimension() int[source]#
Returns the dimensionality (4).
ToAngles() cAngles[source]#
Conversions
ToRotation() cRotation[source]#
ToMat3() cMat3[source]#
ToMat4() cMat4[source]#
ToAngularVelocity() cVec3[source]#
ToFloatPtr() float[source]#
ToStr(nPrec: int = 2) cStr[source]#
Converts quaternion to a string representation.
class cPlane(Normal: cVec3, Offset: float)[source]#

Bases: object

Class representing a generic plane in 3D space.
  • The plane is defined by the equation: ax + by + cz + d = 0.

The vector (a, b, c) represents the plane’s normal, and d represents
the distance factor relative to the origin.
a: float#
brief X component of the plane normal (A in the plane equation).
b: float#
brief Y component of the plane normal (B in the plane equation).
c: float#
brief Z component of the plane normal (C in the plane equation).
d: float#
brief Distance coefficient (D in the plane equation).
SetNormalize(A: float, B: float, C: float, D: float)[source]#
Sets the plane coefficients and normalizes them.
Parameters:
  • A (float) – X component.

  • B (float) – Y component.

  • C (float) – Z component.

  • D (float) – Distance coefficient.

GetNormal() cVec3[source]#
Gets the normal vector of the plane.
Returns:

Const reference to the normal vector (interpreted from a, b, c).

Return type:

cVec3

SetNormal(_0: cVec3)[source]#
Sets the normal vector of the plane.
SetOffset(Offset: float)[source]#
Sets the offset (distance to origin).
  • Note: Internal ‘d’ is stored as -Offset.

Parameters:

Offset (float) – The distance from the origin.

GetOffset() float[source]#
MutableNormal() cVec3[source]#
SetFromPoints(t0: cVec3, t1: cVec3, t2: cVec3) float[source]#
Defines the plane from three points.
Parameters:
  • t0 (cVec3) – First point.

  • t1 (cVec3) – Second point.

  • t2 (cVec3) – Third point.

Returns:

The area of the triangle formed by the points (before normalization).

Return type:

float

SetFromPointAndNormal(Pt: cVec3, Normal: cVec3)[source]#
Defines the plane from a point and a normal.
Parameters:
  • Pt (cVec3) – A point on the plane.

  • Normal (cVec3) – The normal vector.

MoveToPoint(p: cVec3)[source]#
Moves the plane so that it passes through the specified point.
  • The normal vector remains unchanged.

Parameters:

p (cVec3) – The point to move the plane to.

Distance(p: cVec3) float[source]#
Calculates the signed distance from a point to the plane.
Parameters:

p (cVec3) – The point to check.

Returns:

Positive value if in front, negative if behind, zero if on the plane.

Return type:

float

ProjectPoint(p: cVec3) cVec3[source]#
Projects a point onto the plane.
Parameters:

p (cVec3) – The point to project.

Returns:

The projected point on the plane surface.

Return type:

cVec3

ProjectVector(u: cVec3) cVec3[source]#
Projects a vector onto the plane (removes the component parallel to the normal).
Parameters:

u (cVec3) – The vector to project.

Returns:

The projected vector.

Return type:

cVec3

MirrorPoint(p: cVec3) cVec3[source]#
Mirrors a point across the plane.
Parameters:

p (cVec3) – The point to mirror.

Returns:

The mirrored point position.

Return type:

cVec3

MirrorVector(u: cVec3) cVec3[source]#
Mirrors a vector across the plane.
Parameters:

u (cVec3) – The vector to mirror.

Returns:

The mirrored vector.

Return type:

cVec3

MirrorOrient(q: cQuat) cQuat[source]#
Mirrors a quaternion (orientation) across the plane.
Parameters:

q (cQuat) – The orientation to mirror.

Returns:

The mirrored orientation.

Return type:

cQuat

FlipNormal()[source]#
Inverts the normal of the plane and the distance coefficient.
  • Effectively flips the front and back sides of the plane.

BelowPlane(B: any, T: cMat4) bool[source]#
Checks if a bounding box is completely on the negative side of the plane.
Parameters:
  • B – The bounding box.

  • T (cMat4) – Transformation matrix applied to the bounds.

Returns:

True if all vertices are on the back side.

Return type:

bool

ClassifyPoint(p: cVec3, Eps: float) any[source]#
Classifies a point’s position relative to the plane.
Parameters:
  • p (cVec3) – The point to classify.

  • Eps (float) – Epsilon tolerance for “on the plane” check.

Returns:

S_FRONT, S_BACK, or S_ON.

Return type:

any

ClassifySphere(S: any, Eps: float) any[source]#
Classifies a sphere’s position relative to the plane.
Parameters:
  • S – The sphere to classify.

  • Eps (float) – Epsilon tolerance.

Returns:

S_FRONT, S_BACK, or S_CROSS.

Return type:

any

IsFrontFacingTo(Dir: cVec3) bool[source]#
Checks if the plane is facing towards a specific direction.
Parameters:

Dir (cVec3) – The direction vector.

Returns:

True if the plane normal opposes the direction vector (dot product <= 0).

Return type:

bool

RayIntersection(RayOrig: cVec3, RayDir: cVec3, pScale: float = None, pCross: cVec3 = None) bool[source]#
Intersects a ray with the plane.
Parameters:
  • RayOrig (cVec3) – Origin of the ray.

  • RayDir (cVec3) – Direction of the ray.

  • pScale (float) – [out] Optional pointer to store the distance/scale along the ray.

  • pCross (cVec3) – [out] Optional pointer to store the intersection point.

Returns:

True if an intersection occurs (ray is not parallel).

Return type:

bool

SegIntersection(S0: cVec3, S1: cVec3, pCross: cVec3 = None) bool[source]#
Intersects a line segment with the plane.
Parameters:
  • S0 (cVec3) – Start point of the segment.

  • S1 (cVec3) – End point of the segment.

  • pCross (cVec3) – [out] Optional pointer to store the intersection point.

Returns:

True if the segment intersects the plane.

Return type:

bool

PlaneIntersection(P: cPlane, pCross: cVec3 = None, pDir: cVec3 = None) bool[source]#
Intersects this plane with another plane.
Parameters:
  • P (cPlane) – The other plane.

  • pCross (cVec3) – [out] A point on the intersection line.

  • pDir (cVec3) – [out] The direction of the intersection line.

Returns:

True if planes intersect, False if they are parallel.

Return type:

bool

ToPtr() float[source]#
Returns a const raw pointer to the plane coefficients.
Returns:

Const pointer to float array {a, b, c, d}.

Return type:

float

ToVec4() cVec4[source]#
Casts the plane coefficients to a const cVec4 reference.
Returns:

Const reference to cVec4.

Return type:

cVec4

class cMath[source]#

Bases: object

Static helper class providing a wide range of mathematical functions. *
This class includes constants, trigonometry, interpolation (Linear, Cosine, Hermite, TCB),
geometric calculations, random number generation, and utility functions for
floating-point and integer comparisons.
Pi: float = 3.1415927410125732#
TwoPi: float = 6.2831854820251465#
< brief Value of Pi (3.14159…)
HalfPi: float = 1.5707963705062866#
< brief Value of 2 * Pi
QuarterPi: float = 0.7853981852531433#
< brief Value of Pi / 2
RadsPerDeg: float = 0.01745329238474369#
< brief Value of Pi / 4
DegsPerRad: float = 57.2957763671875#
< brief Multiplier to convert Degrees to Radians
Epsilon: float = 0.0010000000474974513#
< brief Multiplier to convert Radians to Degrees
EpsilonSq: float = 1.0000001111620804e-06#
< brief Standard small epsilon for float comparisons
SpaceEpsilon: float = 0.10000000149011612#
< brief Epsilon squared
MatrixEpsilon: float = 9.999999974752427e-07#
< brief Epsilon used for spatial calculations
MatrixInvertEpsilon: float = 9.9999998245167e-15#
< brief Epsilon for matrix operations
dMatrixInvertEpsilon: float = 1.0000000195414814e-24#
< brief Epsilon for matrix inversion checks (float)
dEpsilon: float = 1e-06#
< brief Epsilon for matrix inversion checks (double)
Sqrt1Over2: float = 0.7071067690849304#
< brief Standard small epsilon for double comparisons
Sqrt1Over3: float = 0.5773502588272095#
< brief Square root of 1/2
SecsPerMs: float = 0.0010000000474974513#
< brief Square root of 1/3
MsPerSec: float = 1000.0#
< brief Seconds per Millisecond (0.001)
DoubleMinValue: float = 2.2250738585072014e-308#
< brief Milliseconds per Second (1000.0)
DoubleMaxValue: float = 1.7976931348623157e+308#
< brief Minimum representable positive double (0x0010000000000000)
FloatMinValue: float = 1.1754943508222875e-38#
< brief Maximum representable double (0x7fefffffffffffff)
FloatMaxValue: float = 3.4028234663852886e+38#
< brief Minimum representable positive float (0x00800000)
static IsInfinity(Value: float) bool[source]#
< rief Maximum representable float (0x7f7fffff)
static IsPositiveInfinity(Value: float) bool[source]#
< rief Checks if value is either positive or negative infinity
static IsNegativeInfinity(Value: float) bool[source]#
< rief Checks if value is positive infinity
IntMinValue: int = -2147483648#
< brief Checks if value is negative infinity
IntMaxValue: int = 2147483647#
< brief Minimum integer value (0x80000000)
static MulDiv(Number: int, Numerator: int, Denominator: int) int[source]#
Multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value.
Equivalent to Win32 API “MulDiv”.
Parameters:
  • Number (int) – Multiplicand

  • Numerator (int) – Multiplier

  • Denominator (int) – Divisor

Returns:

(Number * Numerator) / Denominator

Return type:

int

static Rad(Deg: float) float[source]#
< rief Converts Radians to Degrees (float)
static Deg(Rad: float) float[source]#
< rief Converts Degrees to Radians (double)
static Sec(Ms: float) float[source]#
< rief Converts Radians to Degrees (double)
static Ms(Sec: float) float[source]#
< rief Converts Milliseconds to Seconds
static IsOne(f: float, Eps: float) bool[source]#
< rief Checks if float is close to one
static IsMinusOne(f: float, Eps: float) bool[source]#
< rief Checks if double is close to one
static IsZeroToOneExact(f: float) bool[source]#
< rief Checks if float is close to minus one
static IsZeroToOneEps(f: float, Eps: float) bool[source]#
< rief Checks if 0.0 <= f <= 1.0
static IsInRange(i: int, Lo: int, Hi: int) bool[source]#
< rief Checks if -Eps <= f <= 1.0 + Eps
static IsInRangeExact(f: float, Lo: float, Hi: float) bool[source]#
< rief Checks if Lo <= i <= Hi (integer)
static IsInRangeEps(f: float, Lo: float, Hi: float, Eps: float) bool[source]#
< rief Checks if Lo <= f <= Hi (float)
static IsValid(f: float) bool[source]#
< rief Checks if float is a valid number (not infinite, inside bounds)
static IsZero(d: float, Eps: float) bool[source]#
< rief Checks if double is a valid number
static Equals(x: float, y: float, Eps: float) bool[source]#
< rief Checks if double is close to zero
static Clamp01(f: float) float[source]#
static ClampRange1(f: float) float[source]#
< rief Clamps value between 0.0 and 1.0
static ClampRange(f: float, l: float) float[source]#
< rief Clamps value between -1.0 and 1.0
static Lerp(a: float, b: float, s: float) float[source]#
< rief Clamps value between -l and l
static Cerp(a: float, b: float, s: float) float[source]#
< rief Linear Interpolation: a + s * (b - a)
static Lerp05(a: float, b: float) float[source]#
< rief Cosine Interpolation
static Lerper(Fm: float, To: float, x: float) float[source]#
< rief Returns midpoint (a + b) * 0.5
static LerperClamp01(Lo: float, Hi: float, x: float) float[source]#
< rief Inverse Lerp: Returns factor given value x
static MidPointLerp(Start: float, Mid: float, End: float, s: float) float[source]#
< rief Inverse Lerp clamped to [0, 1]
static Abs(x: float) float[source]#
< rief Absolute value (float)
static Round(x: float) float[source]#
< rief Round to nearest integer (float)
static Sqrt(x: float) float[source]#
< rief Square root (float)
static FastInvSqrt(x: float) float[source]#
< rief Square root (double)
static FastSqrt(x: float) float[source]#
< rief Fast Inverse Square Root (Quake III algorithm)
static Sin(a: float) float[source]#
< rief Cosine (float)
static Cos(a: float) float[source]#
< rief Sine (double)
static SinCos(Angle: float, S: float, C: float)[source]#
< rief Simultaneous Sine and Cosine (float)
static Tan(a: float) float[source]#
< rief Tangent (float)
static ASin(x: float) float[source]#
< rief ArcSine (float)
static ACos(x: float) float[source]#
< rief ArcCosine (float)
static ATan(y: float, x: float) float[source]#
< rief ArcTangent2 (y, x) float
static Pow(x: float, y: float) float[source]#
< rief Power x^y (float)
static Exp(x: float) float[source]#
< rief Exponential e^x (float)
static Ldexp(x: float, exp: int) float[source]#
< rief Multiply x by 2^exp (float)
static Frexp(x: float, exp: int) float[source]#
< rief Split x into mantissa and exponent (float)
static Log(x: float) float[source]#
< rief Natural logarithm (float)
static Floor(d: float) float[source]#
< rief Fractional part (float)
static Ceil(d: float) float[source]#
< rief Floor value (double)
static Frac(d: float) float[source]#
< rief Ceiling value (double)
static Periodic(f: float, Lo: float, Hi: float, nPeriods: int = None) float[source]#
< rief Fractional part (double)
static IndexForInsert(f: float, Array: float, nCount: int, Stride: int = 0) int[source]#
< rief Normalizes value to a periodic range
static AngleNormalizeTwoPi(Angle: float) float[source]#
< rief Normalizes angle to [0, 2Pi) (float)
static AngleNormalizePi(Angle: float) float[source]#
< rief Normalizes angle to [0, 2Pi) (double)
static AngleNormalize360(Angle: float) float[source]#
< rief Normalizes angle to (-Pi, Pi]
static AngleNormalize180(Angle: float) float[source]#
< rief Normalizes angle to [0, 360)
static AngleEnsureShortestPath180(Alpha: float, Beta: float)[source]#
< rief Normalizes angle to (-180, 180]
static AngleDeltaRad(Alpha: float, Beta: float) float[source]#
< rief Adjusts Beta so transition from Alpha is shortest
static AngleLerpRad(Alpha: float, Beta: float, s: float) float[source]#
< rief Smallest difference between two angles in radians
static AngleDeltaDeg(Alpha: float, Beta: float) float[source]#
< rief Interpolates between angles in radians correctly
static AngleLerpDeg(Alpha: float, Beta: float, s: float) float[source]#
< rief Smallest difference between two angles in degrees
static ClosestPowerOfTwo(X: int) int[source]#
static UpperPowerOfTwo(X: int) int[source]#
< rief Finds closest power of two
static LowerPowerOfTwo(X: int) int[source]#
< rief Finds next higher power of two
static IsPowerOfTwo(X: int) bool[source]#
< rief Finds next lower power of two
static Randomize(Seed: int)[source]#
static Rand01() float[source]#
< rief Seeds the random generator
static RandBool() bool[source]#
< rief Returns random float in [0, 1]
static RandRange1() float[source]#
< rief Returns random boolean
static dRand(Lo: float, Hi: float) float[source]#
< rief Returns random float in [-1, 1]
static Rand(Lo: int, Hi: int) int[source]#
< rief Returns random float in [Lo, Hi]
static SignBitSet(i: int) int[source]#
static SignBitNotSet(i: int) int[source]#
< rief Returns non-zero if sign bit is set
static TCBAdjInCoeff(tPrev: float, tCur: float, tNext: float) float[source]#
static TCBAdjOutCoeff(tPrev: float, tCur: float, tNext: float) float[source]#
static AlignToDword(i: int) int[source]#
static Checksum(Src: any, Size: int) int[source]#
< rief Aligns integer to 4-byte boundary
static Float2Half(Float: float) int[source]#
< rief Calculates simple checksum
static Half2Float(Half: int) float[source]#
< rief Convert Float32 to Float16 (Half)
static EndianSwap2(Src: any, Count: int = 1) any[source]#
b (byte, char)
static EndianSwap4(Src: any, Count: int = 1) any[source]#
< rief Swap bytes for 16-bit values (Word)
static EndianSwap8(Src: any, Count: int = 1) any[source]#
< rief Swap bytes for 32-bit values (Dword/Float)
static EndianSwap(Src: any, Format: str, Count: int = 1) any[source]#
< rief Swap bytes for 64-bit values (Qword/Double)