Algohol
Revision as of 10:42, 20 February 2008 by imported>Haama (Added tutorial)
Needs to be Updated
This article has been marked by editors as one needing attention. Please see the Talk page for details. If you can update the article, please do so.
Algohol (latest version is Beta v011) is a plugin for OBSE that provides advanced math functions. Algohol stands for "ALGebraic Operations Helper Oblivion Library"
You can download it from TESNexus, discuss it in the Bethesda Forums thread "(WIPz)(OBSE)(PLUGIN)ALGOHOL Project", and check the source code at Source Forge.
Current Commmands
Note that these should all be on one line, and have been split due to wiki limitations (to keep them on the page).
- V3Length - returns length of a vector3
(length:float) V3Length vector_x:float vector_y:float vector_z:float
- V3Normalize - returns normalized vector3
(nothing) V3Normalize out_x:string out_y:string out_z:string vector_x:float vector_y:float vector_z:float
- V3Crossproduct - returns crossproduct of two vector3s
(nothing) V3Crossproduct out_x:string out_y:string out_z:string vectorA_x:float vectorA_y:float vectorA_z:float vectorB_x:float vectorB_y:float vectorB_z:float
- QFromEuler - converts euler angles to quaternion (two euler rotation sequences are available, becouse actors use different sequence than other objects. the default is XYZ, and optionally ZX for actors)
(nothing) QFromEuler out_w:string out_x:string out_y:string out_z:string elevation:float bank:float heading:float flag:bool
- QFromAxisAngle - converts rotation axis and angle to quaternion
(nothing) QFromAxisAngle out_w:string out_x:string out_y:string out_z:string axis_x:float axis_y:float axis_z:float angle:float
- QNormalize - returns normalized quaternion
(nothing) QNormalize out_w:string out_x:string out_y:string out_z:string quat_w:float quat_x:float quat_y:float quat_z:float
- QMultQuat - multiplies two quaternions (Grossmann product). The result is the second quaternion rotated by the first
(nothing) QMultQuat out_w:string out_x:string out_y:string out_z:string quatA_w:float quatA_x:float quatA_y:float quatA_z:float quatB_w:float quatB_x:float quatB_y:float quatB_z:float
- QMultVector3 - multiplies a vector3 with a quaternion. The result is the vector rotated by the quaternion
(nothing) QMultVector3 out_x:string out_y:string out_z:string quat_w:float quat_x:float quat_y:float quat_z:float vector_x:float vector_y:float vector_z:float
- QInterpolate - interpolates between two given quaternions (two methods are available: the default is normalized linear interpolation, and optionally spherical linear interpolation)
(nothing) QInterpolate out_w:string out_x:string out_y:string out_z:string quatA_w:float quatA_x:float quatA_y:float quatA_z:float quatB_w:float quatB_x:float quatB_y:float quatB_z:float ratio:float flag:bool
- QToEuler - converts a given quaternion to euler angles (again, two different euler rotation sequences available). The quaternion does not need to be normalized.
(nothing) QToEuler elevation:string bank:string heading:string quat_w:float quat_x:float quat_y:float quat_z:float flag:bool
Example
float vX float vY float vZ V3Normalize "vX" "vY" "vZ" vX vY vZ
This result will be the normalized (vX; vY; vZ) vector.
Tutorials
Version History
Changes since 0.1
- Fixed handling of actor angles in QFromEuler
- Fixed gimbal lock handling in QToEuler