Core#
Defined in Core.hpp. Logging, time, input, screen info, and world-to-screen projection.
Log#
Prints a message to the Xenon console. This is the only way to output text for debugging since printf is not available.
Note
There is no format string support. To log numbers, convert them to a string manually (see FAQ).
LogDebug#
Prints a debug-level message to the Xenon console.
LogWarning#
Prints a warning-level message to the Xenon console.
LogError#
Prints an error-level message to the Xenon console.
IsIngame#
Returns true if the local player is currently in a match.
GetMapId#
Returns the current map identifier. The value is game-internal; useful for map-specific logic.
GetSensitivity#
Returns the player's in-game mouse sensitivity setting.
GetCurrentHero#
Returns the hero pool ID of the local player's current hero. Compare with HeroId constants.
GetTime#
Returns the current time in seconds since the application started. Useful for animations and timers.
IsKeyDown#
Returns true if the specified key is currently held down.
| Parameter | Type | Description |
|---|---|---|
vkey |
int |
Virtual key code (see VK constants) |
if (IsKeyDown(VK::LButton))
Log("Left mouse button is held");
if (IsKeyDown(VK::Shift))
Log("Shift is held");
Tip
For single-press detection, use IsKeyPressed instead.
IsKeyPressed#
Returns true only on the frame the key transitions from up to down (leading edge). Use this for toggle behavior or single-fire actions.
| Parameter | Type | Description |
|---|---|---|
vkey |
int |
Virtual key code (see VK constants) |
IsKeyReleased#
Returns true only on the frame the key transitions from down to up (trailing edge).
| Parameter | Type | Description |
|---|---|---|
vkey |
int |
Virtual key code (see VK constants) |
ScreenSize#
Returns the current screen resolution as a Vector2.
ScreenCenter#
Returns the center of the screen. Equivalent to ScreenSize() * 0.5f.
WorldToScreen#
Converts a 3D world position to 2D screen coordinates.
Overload 1: Bool return#
Returns true if the position is on screen. The result is written to screenPos.
| Parameter | Type | Description |
|---|---|---|
worldPos |
const Vector3& |
World-space position |
screenPos |
Vector2& |
Output: screen-space position |
| Returns | Description |
|---|---|
true |
Position is on screen, screenPos is valid |
false |
Position is behind the camera |
Vector3 headWorld = enemy.GetBonePos(Bone::Head);
Vector2 headScreen;
if (WorldToScreen(headWorld, headScreen))
{
Draw::CircleFilled(headScreen, 5.f, Color::Red());
}
Overload 2: Direct return#
Returns the screen position directly. If the position is behind the camera, returns {0, 0}.
Vector2 pos = WorldToScreen(enemy.GetPosition());
if (pos.IsValid())
Draw::Text(pos, Color::White(), "Here");
Tip
Prefer the bool overload — it explicitly tells you whether the projection succeeded. The direct return overload can't distinguish "behind camera" from "top-left corner of screen".
GetCameraPosition#
Returns the camera's world-space position, extracted from the view-projection matrix.
Overload 1: Bool return#
Returns true if the camera position is available. The result is written to out.
| Parameter | Type | Description |
|---|---|---|
out |
Vector3& |
Output: world-space camera position |
Overload 2: Direct return#
Returns the camera position directly. Returns {0, 0, 0} if unavailable.
GetCameraForward#
Returns the camera's normalized forward direction, derived from the view-projection matrix.
Overload 1: Bool return#
Returns true if the forward direction is available. The result is written to out.
Overload 2: Direct return#
Returns the forward direction directly. Returns {0, 0, 0} if unavailable.
Vector3 fwd = GetCameraForward();
Vector3 toEnemy = (enemy.GetPosition() - GetCameraPosition()).Normalized();
float dot = fwd.Dot(toEnemy); // 1.0 = directly ahead, 0.0 = perpendicular
GetViewMatrix#
Copies the raw 4x4 view-projection matrix into a 16-float buffer (row-major layout).
| Parameter | Type | Description |
|---|---|---|
out16 |
float* |
Output: 16-float buffer for the 4x4 matrix |
| Returns | Description |
|---|---|
true |
Matrix was available and copied |
false |
Not in-game or matrix unavailable |
float vp[16];
if (GetViewMatrix(vp))
{
// vp[0..3] = row 0
// vp[4..7] = row 1
// vp[8..11] = row 2
// vp[12..15] = row 3
}
Note
This is a combined view-projection matrix, not a separate view or projection matrix. Use GetCameraPosition() and GetCameraForward() for the common cases — the raw matrix is for advanced use like custom projection or off-screen indicators.
Ability Queries#
All ability queries return data for the local player only.
GetUltCharge#
Returns the local player's ultimate charge percentage (0–100).
IsUltReady#
Returns true if ultimate charge is at 100%.
IsUltActive#
Returns true if the ultimate ability is currently active.
IsSkill1Active#
Returns true if Skill 1 (Shift) is currently active.
IsSkill2Active#
Returns true if Skill 2 (E) is currently active.
IsSkill3Active#
Returns true if Skill 3 is currently active.
GetHeroState#
Returns a bitmask of the local player's current state. See HeroState constants.
uint32_t state = GetHeroState();
if (state & HeroState::Ulting)
Log("Ultimate is active");
if (state & HeroState::Reloading)
Log("Reloading");
Hero-Specific Charges#
GetRailgunCharge#
Returns Sojourn's railgun charge level. Only meaningful when playing Sojourn.
GetIllariCharge#
Returns Illari's solar rifle charge level. Only meaningful when playing Illari.
GetHanzoCharge#
Returns Hanzo's bow draw charge level. Only meaningful when playing Hanzo.
GetWidowCharge#
Returns Widowmaker's sniper scope charge level. Only meaningful when playing Widowmaker.
GetLookupSkill#
Generic skill value lookup by ID. Returns cached values for known IDs, 0.0 for unknown IDs.
| Parameter | Type | Description |
|---|---|---|
lookupId |
uint16_t |
Skill lookup ID (see SkillId constants) |
float charge = GetLookupSkill(SkillId::SojournCharge);
float ult = GetLookupSkill(SkillId::UltCharge);
Note
Only a subset of lookup IDs are currently cached. Unknown IDs return 0.0. See SkillId constants for supported IDs.
Aim Control#
Functions for controlling the local player's view direction. These use the same mechanism as the internal aimbot: writing the direction vector directly into game memory.
Warning
Using aim functions while the internal aimbot is active will cause conflicts. Disable the built-in aimbot for heroes where your plugin handles aiming.
AimSetDirection#
Sets the view direction vector instantly (no smoothing). The vector is normalized automatically. Resets any active spring smoothing state.
| Parameter | Type | Description |
|---|---|---|
dir |
const Vector3& |
Desired view direction (will be normalized) |
Vector3 toEnemy = (enemy.GetHeadPos() - GetCameraPosition()).Normalized();
AimSetDirection(toEnemy);
AimGetDirection#
Returns the local player's current view direction vector.
AimSetAngles#
Sets the view angles in radians (instant, no smoothing). Pitch is clamped to +/-89 degrees. Resets any active spring smoothing state.
| Parameter | Type | Description |
|---|---|---|
pitch |
float |
Vertical angle in radians (negative = look up, positive = look down) |
yaw |
float |
Horizontal angle in radians |
Vector3 angles = CalcAngle(GetCameraPosition(), enemy.GetHeadPos());
AimSetAngles(angles.x, angles.z); // .x = pitch, .z = yaw
AimGetAngles#
Returns the current view angles as (pitch, yaw) in radians.
Vector2 angles = AimGetAngles(); // .x = pitch, .y = yaw
float pitch, yaw;
AimGetAngles(pitch, yaw);
AimAtPosition#
Aims at a world-space position using a critically-damped spring for smooth, human-like motion. Call this every frame while tracking a target.
| Parameter | Type | Description |
|---|---|---|
target |
const Vector3& |
World-space position to aim at |
stiffness |
float |
Spring stiffness: 0 = instant snap, 10-200 = human-like, 500+ = near-instant |
The spring model guarantees no overshoot or oscillation. Higher stiffness values mean faster convergence.
// Smooth aim at enemy head
Entity target = FindBestTargetInFov(100.f, Bone::Head, TargetFlags::Enemy | TargetFlags::Visible);
if (target)
AimAtPosition(target.GetHeadPos(), 80.f);
AimAtBone#
Aims at a specific bone on an entity with spring smoothing. Convenience wrapper that resolves the bone position internally.
| Parameter | Type | Description |
|---|---|---|
entityIndex |
int |
Player array index |
boneId |
int |
Skeleton bone ID (see Bone constants) |
stiffness |
float |
Spring stiffness (same as AimAtPosition) |
Entity target = FindBestTargetInFov(100.f, Bone::Head, TargetFlags::Enemy);
if (target)
AimAtBone(target.Index(), Bone::Head, 50.f);
AimResetSmoothing#
Resets the spring smoothing velocity to zero. Call this when switching targets to prevent the spring's momentum from the previous target carrying over and causing a snap.
if (newTarget != lastTarget)
{
AimResetSmoothing();
lastTarget = newTarget;
}
AimAtBone(newTarget.Index(), Bone::Head, 80.f);
AimHitsHitbox#
Checks if the current aim direction passes through any hitbox on the given entity. Use this for fire gating — only fire when the crosshair is actually on the target.
| Parameter | Type | Description |
|---|---|---|
entityIndex |
int |
Player array index |
hitboxScale |
float |
Hitbox radius multiplier (1.0 = exact, >1.0 = forgiving) |
| Returns | Description |
|---|---|
>= 0 |
BodySlot index of the first hit hitbox |
-1 |
No hitbox hit |