Skip to content

Latest commit

 

History

History
600 lines (490 loc) · 49.2 KB

Short_Documentation.md

File metadata and controls

600 lines (490 loc) · 49.2 KB

PCapture-LIB v3.4 Short Documentation

This document provides a concise overview of PCapture-Lib's modules and their key functionalities.

Each module's section below links to the corresponding readme.md within the module directory for detailed information and examples. You can also navigate to specific sections within each module's documentation by clicking on the header or the function/method.

Table of Contents

0. Console Commands

The following console commands are available for debugging and managing the library during runtime:

  • PCapLib_version: Prints the current library version.
  • PCapLib_level_trace: Sets the logger level to Trace.
  • PCapLib_level_debug: Sets the logger level to Debug.
  • PCapLib_level_info: Sets the logger level to Info.
  • PCapLib_level_warn: Sets the logger level to Warning.
  • PCapLib_level_error: Sets the logger level to Error.
  • PCapLib_level_off: Sets the logger level to Off.
  • PCapLib_schedule_list: Lists all currently scheduled events.
  • PCapLib_schedule_clear: Cancels all currently scheduled events.
  • PCapLib_vscript_event_list: Lists all registered script events.
  • PCapLib_players_list: Lists all current players.

Enhances ray tracing capabilities, including portal and custom trace settings.

Class/Type/Method Description
TracePlus.Settings Encapsulates trace settings.
new(settingsTable: table) Creates a TracePlus.Settings object.
SetIgnoredClasses(ignoreClassesArray: ArrayEx) Sets ignored classes.
SetPriorityClasses(priorityClassesArray: ArrayEx) Sets priority classes.
SetIgnoredModels(ignoredModelsArray: ArrayEx) Sets ignored models.
SetDepthAccuracy(value: number) Sets depth accuracy.
SetBynaryRefinement(bool: bool) Sets binary refinement.
AppendIgnoredClass(className: string) Appends ignored class.
AppendPriorityClasses(className: string) Appends to priority classes.
AppendIgnoredModel(modelName: string) Appends ignored model.
SetCollisionFilter(filterFunction: function) Sets collision filter.
SetIgnoreFilter(filterFunction: function) Sets ignore filter.
GetIgnoreClasses() -> ArrayEx Returns ignored classes.
GetPriorityClasses() -> ArrayEx Returns priority classes.
GetIgnoredModels() -> ArrayEx Returns ignored models.
GetCollisionFilter() -> function Returns collision filter function.
GetIgnoreFilter() -> function Returns ignore filter function.
ApplyCollisionFilter(entity: pcapEntity, note: string) Applies collision filter.
ApplyIgnoreFilter(entity: pcapEntity, note: string) Applies ignore filter.
UpdateIgnoreEntities(ignoreEntities: table, newEnt: pcapEntity) Updates ignored entities.
Class/Method Description
CheapTraceResult Result of a cheap trace.
GetStartPos() -> Vector Returns start position.
GetEndPos() -> Vector Returns end position.
GetHitpos() -> Vector Returns hit position.
GetFraction() -> number Returns hit fraction.
DidHit() -> bool Returns true if hit.
GetDir() -> Vector Returns trace direction.
GetPortalEntryInfo() -> CheapTraceResult Returns portal entry info.
GetAggregatedPortalEntryInfo() -> ArrayEx Returns all portal entry info.
GetImpactNormal() -> Vector Returns impact normal.
BboxTraceResult Result of a bbox cast.
GetEntity() -> pcapEntity Returns hit entity.
GetEntityClassname() -> string Returns hit entity classname.
GetIngoreEntities() -> table Returns ignored entities.
GetTraceSettings() -> TraceSettings Returns trace settings.
GetNote() -> string Returns trace note.
DidHitWorld() -> bool Returns true if hit world geometry.
Function Description
TracePlus.Cheap(startPos: Vector, endPos: Vector) -> CheapTraceResult Performs a cheap trace.
TracePlus.FromEyes.Cheap(distance: number, player: pcapEntity) -> CheapTraceResult Cheap trace from player's eyes.
Function Description
TracePlus.Bbox(startPos: Vector, endPos: Vector, ignoreEntities: table, settings: TraceSettings, note: string) -> BboxTraceResult Performs a bbox cast.
TracePlus.FromEyes.Bbox(distance: number, player: pcapEntity, ignoreEntities: table, settings: TraceSettings) -> BboxTraceResult Bbox cast from player's eyes.
Function Description
TracePlus.PortalCheap(startPos: Vector, endPos: Vector) -> CheapTraceResult Cheap trace with portals.
TracePlus.FromEyes.PortalCheap(distance: number, player: pcapEntity) -> CheapTraceResult Cheap trace from player's eyes with portals.
TracePlus.PortalBbox(startPos: Vector, endPos: Vector, ignoreEntities: table, settings: TraceSettings, note: string) -> BboxTraceResult Bbox cast with portals.
TracePlus.FromEyes.PortalBbox(distance: number, player: pcapEntity, ignoreEntities: table, settings: TraceSettings) -> BboxTraceResult Bbox cast from player's eyes with portals.
Class/Method Description
TraceLineAnalyzer Precise trace line analysis.
Function Description
CalculateImpactNormal(startPos: Vector, hitPos: Vector) -> Vector Impact normal for world geometry.
CalculateImpactNormalFromBbox(startPos: Vector, hitPos: Vector, hitEntity: pcapEntity) -> Vector Impact normal from bounding box.
CalculateImpactNormalFromBbox2(startPos: Vector, hitPos: Vector, hitEntity: pcapEntity) -> Vector Fallback bounding box normal.

2. IDT

Provides enhanced data structures.

Function/Method Description
ArrayEx(...) Creates an ArrayEx.
FromArray(array: array) -> ArrayEx ArrayEx from array.
append(value: any) -> ArrayEx Appends a value.
apply(func: function) -> ArrayEx Applies a function to each element.
clear() -> ArrayEx Clears the array.
extend(other: array|ArrayEx) -> ArrayEx Extends the array.
filter(func: function) -> ArrayEx Filters the array.
contains(value: any) -> bool Checks for value.
search(value: any) -> number Search by value or predicate.
insert(index: number, value: any) Inserts a value.
len() -> number Returns length.
map(func: function) -> ArrayEx Maps values.
reduce(func: Function, initial: any) -> any Reduces the array.
unique() -> ArrayEx Returns unique elements.
pop() -> any Removes last element.
push(value: any) Adds to the end.
remove(index: number) -> any Removes at index.
resize(size: number, fill: any) Resizes the array.
reverse() -> ArrayEx Reverses the array.
slice(start: number, end: number) -> ArrayEx Creates a slice.
sort(func: function) -> ArrayEx Sorts the array.
top() -> any Returns last element.
join(separator: string) -> string Joins to string.
get(index: number, default: any) -> any Gets element at index.
totable(recreate: bool) -> table Converts to table.
tolist() -> List Converts to List.
Function/Method Description
List(...) Creates a List.
FromArray(array: array) -> List Creates List from array.
len() -> number Returns length.
iter() -> iterator Returns efficient iterator.
rawIter() -> iterator Returns raw node iterator.
append(value: any) Appends a value.
insert(index: number, value: any) Inserts a value.
getNode(index: number) -> ListNode Gets node at index.
get(index: number, defaultValue: any) -> any Gets value at index.
remove(index: number) -> any Removes at index.
pop() -> any Removes last element.
top() -> any Gets last element.
reverse() Reverses the list.
unique() -> List Returns unique elements list.
clear() Clears the list.
join(separator: string) -> string Joins to string.
apply(func: function) -> List Applies a function.
extend(other: iterable) -> List Extends the list.
search(value: any|function) -> number Search by value or predicate.
map(func: function) -> List Maps values.
filter(condition: function) -> List Filters the list.
reduce(func: function, initial: any) -> any Reduces the list.
totable() -> table Converts to table.
toarray() -> array Converts to array.
SwapNode(node1: ListNode, node2: ListNode) Swaps nodes.
Function/Method Description
AVLTree(...) Creates an AVL tree.
FromArray(array: array) -> AVLTree AVL tree from array.
len() -> number Number of nodes.
toarray() -> ArrayEx Converts to array (inorder).
tolist() -> List Converts to list (inorder).
insert(key: any) Inserts a node.
search(value: any) -> treeNode Searches for a node.
remove(value: any) Removes a node.
GetMin() -> any Gets minimum value.
GetMax() -> any Gets maximum value.
inorderTraversal() -> ArrayEx Inorder traversal.
printTree() Prints tree structure.
Function Description
CreateByClassname(classname: string, keyvalues: table) -> pcapEntity Creates entity.
CreateProp(classname: string, origin: Vector, modelname: string, activity: number, keyvalues: table) -> pcapEntity Creates prop.
FromEntity(CBaseEntity: CBaseEntity) -> pcapEntity pcapEntity from CBaseEntity.
FindByClassname(classname: string, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entity by classname.
FindByClassnameWithin(classname: string, origin: Vector, radius: number, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entity within radius.
FindByName(targetname: string, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entity by name.
FindByNameWithin(targetname: string, origin: Vector, radius: number, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entity by name within radius.
FindByModel(model: string, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entity by model.
FindByModelWithin(model: string, origin: Vector, radius: number, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entity by model within radius.
FindInSphere(origin: Vector, radius: number, start_ent: CBaseEntity|pcapEntity) -> pcapEntity Finds entities in sphere.

Provides the pcapEntity class, extending CBaseEntity functionality.

Category Methods
State/Lifecycle GetIndex() -> number, IsValid() -> bool, IsPlayer() -> bool, isEqually(other: pcapEntity|CBaseEntity) -> bool, Destroy(fireDelay: number, eventName: string), Kill(fireDelay: number, eventName: string), Dissolve(fireDelay: number, eventName: string), Disable(fireDelay: number, eventName: string), Enable(fireDelay: number, eventName: string), IsDrawEnabled() -> bool
Naming SetName(name: string, fireDelay: number, eventName: string), SetUniqueName(prefix: string, fireDelay: number, eventName: string), GetNamePrefix() -> string, GetNamePostfix() -> string
Player EyePosition() -> Vector, EyeAngles() -> Vector, EyeForwardVector() -> Vector
Transform SetAngles(x: number, y: number, z: number), SetAbsAngles(angles: Vector), SetCenter(vector: Vector), SetParent(parentEnt: string|CBaseEntity|pcapEntity, fireDelay: number, eventName: string), GetParent() -> pcapEntity, SetModelScale(scaleValue: number, fireDelay: number, eventName: string), GetModelScale() -> number
Appearance SetAlpha(opacity: number, fireDelay: number, eventName: string), SetColor(colorValue: string|Vector, fireDelay: number, eventName: string), SetSkin(skin: number, fireDelay: number, eventName: string), SetDrawEnabled(isEnabled: bool, fireDelay: number, eventName: string), SetAnimation(animationName: string, fireDelay: number, eventName: string), GetAlpha() -> number, GetColor() -> string, GetSkin() -> number, GetPartnerInstance() -> pcapEntity
KeyValues/Data SetKeyValue(key: string, value: any, fireDelay: number, eventName: string), SetUserData(name: string, value: any), GetUserData(name: string) -> any, GetKeyValue(key: string) -> any, SetContext(name: string, value: any, fireDelay: number, eventName: string)
Collision SetCollision(solidType: number, fireDelay: number, eventName: string), SetCollisionGroup(collisionGroup: number, fireDelay: number, eventName: string), SetTraceIgnore(isEnabled: bool, fireDelay: number, eventName: string), SetSpawnflags(flag: number, fireDelay: number, eventName: string), GetSpawnflags() -> number
Sound EmitSound(soundName: string, fireDelay: number, eventName: string), EmitSoundEx(soundName: string, volume: number, looped: bool, fireDelay: number, eventName: string), StopSoundEx(soundName: string, fireDelay: number, eventName: string)
Outputs/Inputs AddOutput(outputName: string, target: string|CBaseEntity|pcapEntity, input: string, param: string, delay: number, fires: number), ConnectOutputEx(outputName: string|function, script: string, delay: number, fires: number), SetInputHook(inputName: string, closure: function)
BBox/Position SetBBox(minBounds: Vector|string, maxBounds: Vector|string), GetBBox() -> table, IsSquareBbox() -> bool, GetAABB() -> table, CreateAABB(stat: number) -> Vector, getBBoxPoints() -> array, getBBoxFaces() -> array

Provides utility functions.

Function Description
DrawEntityBBox(ent: pcapEntity|CBaseEntity, color: Vector, time: number) Draws bounding box.
DrawEntityAABB(ent: pcapEntity|CBaseEntity, color: Vector, time: number) Draws AABB.
drawbox(vector: Vector, color: Vector, time: number) Draws a box.
trace(msg: string, ...) Trace log.
debug(msg: string, ...) Debug log.
info(msg: string, ...) Info log.
warning(msg: string, ...) Warning log.
error(msg: string, ...) Error log.
Class/Method Description
File(path: string) Creates a File object.
write(text: string) Writes text.
writeRawData(text: string) Writes raw data.
readlines() -> array Reads all lines.
read() -> string Reads entire content.
clear() Clears file content.
updateInfo() Updates file info.
Function Description
FrameTime() -> number Improved FrameTime.
UniqueString(prefix: string) -> string Unique string with prefix.
EntFireByHandle(target: CBaseEntity|pcapEntity, action: string, value: string, delay: number, activator: CBaseEntity|pcapEntity, caller: CBaseEntity|pcapEntity) Improved EntFireByHandle.
GetPlayerEx(index: number) -> pcapEntity Returns pcapEntity for player.
Function Description
GetPlayers() -> array Array of players.
TrackPlayerJoins() Tracks player joins.
HandlePlayerEventsMP() Handles MP events.
HandlePlayerEventsSP() Handles SP events.
_monitorRespawn(player: pcapEntity) Monitors respawns.
AttachEyeControl(player: pcapEntity) Attaches eye control.
OnPlayerJoined(player: pcapEntity) Player joined hook.
OnPlayerLeft(player: pcapEntity) Player left hook.
OnPlayerDeath(player: pcapEntity) Player death hook.
OnPlayerRespawn(player: pcapEntity) Player respawn hook.
Function Description
InitPortalPair(id: number) Initialize portal pair.
IsBluePortal(ent: pcapEntity) -> bool Checks for blue portal.
FindPartnerForPropPortal(portal: pcapEntity) -> pcapEntity Finds portal partner.
_CreatePortalDetector(extraKey: string, extraValue: any) -> entity Internal function
SetupLinkedPortals() Setups up linked portals.
Macro Description
Precache(soundPath: string|array|ArrayEx) Precaches sound(s).
GetSoundDuration(soundName: string) -> number Gets sound duration.
CreateAlias(key: string, action: string) Creates a simple console alias.
CreateCommand(key: string, command: string) Creates a console command.
format(msg: string, ...) -> string Formats message string.
fprint(msg: string, ...) Formats and prints.
CompileFromStr(funcBody: string, ...) Compiles a function from a string representation.
GetFromTable(table: table, key: any, defaultValue: any) -> any Gets from table with default.
GetKeys(table: object) -> List Returns keys from table as List.
GetValues(table: object) -> List Returns values from table as List.
InvertTable(table: table) -> table Inverts table.
PrintIter(iterable: iterable) Prints iterable.
MaskSearch(iter: array|ArrayEx, match: string) -> number Mask search in array.
GetRectangle(v1: Vector, v2: Vector, v3: Vector, v4: Vector) -> table Creates rectangle object.
PointInBBox(point: Vector, bMin: Vector, bMax: Vector) -> bool Point in bbox check.
PointInBounds(point: Vector) -> bool Point in world's bounds check.
Range(start: number, end: number, step: number) -> List Creates number range as List.
RangeIter(start: number, end: number, step: number) -> iterator Creates number range iterator.
GetDist(vec1: Vector, vec2: Vector) -> number Distance between vectors.
StrToVec(str: string) -> Vector String to vector.
VecToStr(vec: Vector, sep: String) -> string Vector to string.
isEqually(val1: any, val2: any) -> bool Equality check.
DeepCopy(container: iter) -> iter Deep copy of a container.
GetPrefix(name: string) -> string Name prefix.
GetPostfix(name: string) -> string Name postfix.
GetEyeEndpos(player: CBaseEntity|pcapEntity, distance: number) -> Vector Eye raycast endpoint.
GetVertex(x: Vector, y: Vector, z: Vector, ang: Vector) -> Vector BBox vertex position.
GetTriangle(v1: Vector, v2: Vector, v3: Vector) -> table Creates triangle representation.
BuildAnimateFunction(name: string, propertySetterFunc: function, valueCalculator: function) -> function Creates a new animation function.
BuildRTAnimateFunction(name: string, propertySetterFunc: function, valueCalculator: function) -> function Creates a new real-time animation function.

Provides enhanced event scheduling.

Class/Method Description
ScheduleAction(scope: any, action: string|function, timeDelay: number, args: array) Creates scheduled action.
run() Executes the action.
Function Description
Add(eventName: string, action: string|function, timeDelay: number, args: array, scope: object) Adds scheduled event.
AddInterval(eventName: string, action: string|function, interval: number, initialDelay: number, args: array, scope: any) Adds interval event.
AddActions(eventName: string, actions: array|List, noSort: bool) Adds multiple actions.
Cancel(eventName: string, delay: number) Cancels event.
TryCancel(eventName: string, delay: number) -> bool Tries to cancel event.
CancelByAction(action: string|function, delay: number) Cancels by action.
CancelAll() Cancels all events.
GetEvent(eventName: string) -> List Gets event actions.
IsValid(eventName: string) -> bool Checks event validity.

Provides animation functions.

Class/Function Description
AnimEvent(name: string, settings: table, entities: array|CBaseEntity|pcapEntity, time: number) Animation event data.
applyAnimation(animInfo: AnimEvent, valueCalculator: function, propertySetter: function, vars: any, transitionFrames: number) Applies animation.
applyRTAnimation(animInfo: AnimEvent, valueCalculator: function, propertySetter: function, vars: any, transitionFrames: number) Applies real-time animation.
_applyRTAnimation(animInfo: AnimEvent, valueCalculator: function, propertySetter: function, vars: any, transitionFrames: number) Internal function for real-time animation.
Function Description
AlphaTransition(entities: array|CBaseEntity|pcapEntity, startOpacity: number, endOpacity: number, time: number, animSetting: table) -> number Animates alpha.
ColorTransition(entities: array|CBaseEntity|pcapEntity, startColor: string|Vector, endColor: string|Vector, time: number, animSetting: table) -> number Animates color.
PositionTransitionByTime(entities: array|CBaseEntity|pcapEntity, startPos: Vector, endPos: Vector, time: number, animSetting: table) -> number Animates position by time.
PositionTransitionBySpeed(entities: array|CBaseEntity|pcapEntity, startPos: Vector, endPos: Vector, speed: number, animSetting: table) -> number Animates position by speed.
AnglesTransitionByTime(entities: array|CBaseEntity|pcapEntity, startAngles: Vector, endAngles: Vector, time: number, animSetting: table) -> number Animates angles.
Class/Method Description
VGameEvent(eventName: string, triggerCount: number, actionsList: function) Creates a VGameEvent.
AddAction(actionFunction: function) Adds action to event.
ClearActions() Clears actions.
SetFilter(filterFunc: function) Sets filter function.
Trigger(args: any) Triggers event.
ForceTrigger(args: any) Forces trigger.
Function Description
Notify(eventName: string, ...) Triggers event by name.
GetEvent(EventName: string) -> VGameEvent Gets VGameEvent object.

7. HUD

Class/Method Description
ScreenText(position: Vector, message: string, holdtime: number, targetname: string) Creates screen text.
Enable(holdTime: number) Shows the text.
Disable() Hides the text.
Update() Updates the text.
SetText(message: string) -> ScreenText Sets text message.
SetChannel(value: number) -> ScreenText Sets channel.
SetColor(string_color: string) -> ScreenText Sets color.
SetColor2(string_color: string) -> ScreenText Sets secondary color.
SetEffect(value: number) -> ScreenText Sets effect.
SetFadeIn(value: number) -> ScreenText Sets fade-in.
SetFadeOut(value: number) -> ScreenText Sets fade-out.
SetHoldTime(time: number) -> ScreenText Sets hold time.
SetPos(Vector: Vector) -> ScreenText Sets position.
Class/Method Description
HintInstructor(message: string, holdtime: number, icon: string, showOnHud: number, targetname: string) Creates hint.
Enable() Shows the hint.
Disable() Hides the hint.
Update() Updates the hint.
SetText(message: string) -> HintInstructor Sets hint message.
SetBind(bind: string) -> HintInstructor Sets bind.
SetPositioning(value: number, ent: CBaseEntity|pcapEntity) -> HintInstructor Sets positioning.
SetColor(string_color: string) -> HintInstructor Sets color.
SetIconOnScreen(icon: string) -> HintInstructor Sets on-screen icon.
SetIconOffScreen(screen: string) -> HintInstructor Sets off-screen icon.
SetHoldTime(time: number) -> HintInstructor Sets hold time.
SetDistance(value: number) -> HintInstructor Sets distance.
SetEffects(sizePulsing: number, alphaPulsing: number, shaking: number) -> HintInstructor Sets effects.

8. Math

Provides various mathematical functions and objects.

Provides basic algebraic functions.

Function Description
min(...) Finds minimum value.
max(...) Finds maximum value.
clamp(number: number, min: number, max: number) Clamps a number.
round(value: number, precision: number) Rounds a number.
Sign(x: number) Sign of number (-1, 0, or 1)
copysign(value: number, sign: number) Copies sign to value.
RemapVal(val: number, A: number, B: number, C: number, D: number) Remaps value between ranges.

Provides utility functions for working with vectors.

Function Description
vector.isEqually(vec1: Vector, vec2: Vector) Vector equality check (integers).
vector.isEqually2(vec1: Vector, vec2: Vector, precision: number) Vector approximate equality.
vector.mul(vec1: Vector, vec2: Vector) Element-wise multiplication.
vector.rotate(vec: Vector, angle: Vector) Vector rotation.
vector.unrotate(vec: Vector, angle: Vector) Vector unrotation.
vector.random(min: Vector|number, max: Vector|number) Random vector generation.
vector.reflect(dir: Vector, normal: Vector) Reflects vector off normal.
vector.clamp(vec: Vector, min: number, max: number) Clamps vector components.
vector.resize(vec: Vector, newLength: number) Resizes vector to new length.
vector.round(vec: Vector, precision: number) Rounds vector components.
vector.sign(vec: Vector) Returns vector of component signs.
vector.abs(vector: Vector) Returns vector with absolute components.

Provides linear interpolation functions.

| Function | Description | |---|---|math | lerp.number(start: number, end: number, t: number) | Number interpolation. | | lerp.vector(start: Vector, end: Vector, t: number) | Vector interpolation. | | lerp.color(start: string\|Vector, end: string\|Vector, t: number) | Color interpolation. | | lerp.sVector(start: Vector, end: Vector, t: number) | Spherical vector interpolation. | | lerp.SmoothStep(edge0: number, edge1: number, x: number) | Smoothstep interpolation. | | lerp.FLerp(f1: number, f2: number, i1: number, i2: number, x: number) | Custom parameter interpolation. |

Provides various easing functions.

Function Description
ease.InSine(t: number), ease.OutSine(t: number), ease.InOutSine(t: number) Sine easing functions.
ease.InQuad(t: number), ease.OutQuad(t: number), ease.InOutQuad(t: number) Quadratic easing functions.
ease.InCubic(t: number), ease.OutCubic(t: number), ease.InOutCubic(t: number) Cubic easing functions.
ease.InQuart(t: number), ease.OutQuart(t: number), ease.InOutQuart(t: number) Quartic easing functions.
ease.InQuint(t: number), ease.OutQuint(t: number), ease.InOutQuint(t: number) Quintic easing functions.
ease.InExpo(t: number), ease.OutExpo(t: number), ease.InOutExpo(t: number) Exponential easing functions.
ease.InCirc(t: number), ease.OutCirc(t: number), ease.InOutCirc(t: number) Circular easing functions.
ease.InBack(t: number), ease.OutBack(t: number), ease.InOutBack(t: number) Back easing functions.
ease.InElastic(t: number), ease.OutElastic(t: number), ease.InOutElastic(t: number) Elastic easing functions.
ease.InBounce(t: number), ease.OutBounce(t: number), ease.InOutBounce(t: number) Bounce easing functions.

Provides quaternion operations.

Function/Method Description
Quaternion(x: number, y: number, z: number, w: number) Creates a quaternion.
fromEuler(angles: Vector) -> Quaternion Quaternion from Euler angles.
fromVector(vector: Vector) -> Quaternion Quaternion from vector.
rotateVector(vector: Vector) -> Vector Rotates vector by quaternion.
unrotateVector(vector: Vector) -> Vector Unrotates vector by quaternion.
slerp(targetQuaternion: Quaternion, t: number) -> Quaternion Spherical linear interpolation.
normalize() -> Quaternion Normalizes quaternion.
dot(other: Quaternion) -> number Dot product of quaternions.
length() -> number Quaternion length.
inverse() -> Quaternion Inverse of quaternion.
fromAxisAngle(axis: Vector, angle: number) -> Quaternion Quaternion from axis-angle.
toAxisAngle() -> table Converts to axis-angle.
toVector() -> Vector Converts to Euler angles.
isEqually(other: Quaternion) -> bool Quaternion equality check.
cmp(other: Quaternion) -> number Compares quaternion magnitudes.

Provides matrix operations.

Function/Method Description
Matrix(...) Creates a matrix (see full docs for arguments).
fromEuler(angles: Vector) -> Matrix Matrix from Euler angles.
rotateVector(point: Vector) -> Vector Rotates vector by matrix.
unrotateVector(point: Vector) -> Vector Unrotates vector by matrix.
transpose() -> Matrix Transposes matrix.
inverse() -> Matrix Inverts matrix.
determinant() -> number Matrix determinant.
scale(factor: number) -> Matrix Scales matrix.
rotateX(angle: number) -> Matrix Rotates matrix around X axis.
_mul(other: Matrix) -> Matrix Matrix multiplication.
_add(other: Matrix) -> Matrix Matrix addition.
_sub(other: Matrix) -> Matrix Matrix subtraction.
isEqually(other: Matrix) -> bool Matrix equality check.
cmp(other: Matrix) -> number Compares matrix component sums.