Extra Math for GDScript

An asset by balintbarna
The page banner background of a mountain and forest
Extra Math for GDScript hero image

Quick Information

0 ratings
Extra Math for GDScript icon image
balintbarna
Extra Math for GDScript

Provides easy-to-use math functions that are not yet available in the stable engine builds. Functionality includes Euler conversions, conversion to axis-angle vector, and more. If you would like to add a common math function please submit an issue on GitHub.Usage example:```var from = Vector3.FORWARDvar to = Vector3(1, 0, 1)var rot = ExtraMath.get_vectors_rotation(from, to)var to_calculated = from.rotated(rot.normalized(), rot.length())var to_calculated_with_basis = Basis(rot.normalized(), rot.length()) * from```Functions in current version: usec_to_sec(usec: int) sec_to_usec(sec: float) get_vectors_rotation(from: Vector3, to: Vector3) basis2axis_angle(b: Basis) quat2axis_angle(q: Quat) quat2euler(q: Quat, order = DEFAULT_EULER_ORDER) basis2euler(b: Basis, order = DEFAULT_EULER_ORDER) euler2quat(angles: Vector3, order = DEFAULT_EULER_ORDER) euler2basis(angles: Vector3, order = DEFAULT_EULER_ORDER)Constants in current version: const EPSILON = 0.00001 const EPSILON2 = (EPSILON * EPSILON) const SQRTHALF = 0.7071067811865475244008443621048490 const SQRT2 = 1.4142135623730950488016887242 const LN2 = 0.6931471805599453094172321215 const EULER = 2.7182818284590452353602874714 const DEFAULT_EULER_ORDER = "yxz"For more details see the comments in the code.

Supported Engine Version
3.4
Version String
1.0.0
License Version
Unlicense
Support Level
community
Modified Date
3 years ago
Git URL
Issue URL

Provides easy-to-use math functions that are not yet available in the stable engine builds. Functionality includes Euler conversions, conversion to axis-angle vector, and more. If you would like to add a common math function please submit an issue on GitHub.

Usage example:
```
var from = Vector3.FORWARD
var to = Vector3(1, 0, 1)
var rot = ExtraMath.get_vectors_rotation(from, to)
var to_calculated = from.rotated(rot.normalized(), rot.length())
var to_calculated_with_basis = Basis(rot.normalized(), rot.length()) * from
```

Functions in current version:
usec_to_sec(usec: int)
sec_to_usec(sec: float)
get_vectors_rotation(from: Vector3, to: Vector3)
basis2axis_angle(b: Basis)
quat2axis_angle(q: Quat)
quat2euler(q: Quat, order = DEFAULT_EULER_ORDER)
basis2euler(b: Basis, order = DEFAULT_EULER_ORDER)
euler2quat(angles: Vector3, order = DEFAULT_EULER_ORDER)
euler2basis(angles: Vector3, order = DEFAULT_EULER_ORDER)

Constants in current version:
const EPSILON = 0.00001
const EPSILON2 = (EPSILON * EPSILON)
const SQRTHALF = 0.7071067811865475244008443621048490
const SQRT2 = 1.4142135623730950488016887242
const LN2 = 0.6931471805599453094172321215
const EULER = 2.7182818284590452353602874714
const DEFAULT_EULER_ORDER = "yxz"

For more details see the comments in the code.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Extra Math for GDScript icon image
balintbarna
Extra Math for GDScript

Provides easy-to-use math functions that are not yet available in the stable engine builds. Functionality includes Euler conversions, conversion to axis-angle vector, and more. If you would like to add a common math function please submit an issue on GitHub.Usage example:```var from = Vector3.FORWARDvar to = Vector3(1, 0, 1)var rot = ExtraMath.get_vectors_rotation(from, to)var to_calculated = from.rotated(rot.normalized(), rot.length())var to_calculated_with_basis = Basis(rot.normalized(), rot.length()) * from```Functions in current version: usec_to_sec(usec: int) sec_to_usec(sec: float) get_vectors_rotation(from: Vector3, to: Vector3) basis2axis_angle(b: Basis) quat2axis_angle(q: Quat) quat2euler(q: Quat, order = DEFAULT_EULER_ORDER) basis2euler(b: Basis, order = DEFAULT_EULER_ORDER) euler2quat(angles: Vector3, order = DEFAULT_EULER_ORDER) euler2basis(angles: Vector3, order = DEFAULT_EULER_ORDER)Constants in current version: const EPSILON = 0.00001 const EPSILON2 = (EPSILON * EPSILON) const SQRTHALF = 0.7071067811865475244008443621048490 const SQRT2 = 1.4142135623730950488016887242 const LN2 = 0.6931471805599453094172321215 const EULER = 2.7182818284590452353602874714 const DEFAULT_EULER_ORDER = "yxz"For more details see the comments in the code.

Supported Engine Version
3.4
Version String
1.0.0
License Version
Unlicense
Support Level
community
Modified Date
3 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers