source2
Interact with the source2 engine.
When using the functions prefixed with read from the info is returned directly from memory. It's strongly advised that these functions are never called within the paint callback. Calling these functions within the paint callback, may cause unexpected performance drops. Querying the game's memory is expensive, and doing it every frame is not optimal.
Functions:
Read Entity By Index
source2.read_entity_by_index(integer: entity_list_pointer, integer: index)Returns a pointer to a instance from the entity list based on the specified index.
Get Index From Handle
source2.get_index_from_handle(integer: handle)Extracts the entity index from the handle by masking the lower 15 bits
World To Screen
source2.world_to_screen(vector: world_position, matrix_4x4: view_matrix)Converts 3D world coordinates (either individual x, y, z or a vector) into 2D screen coordinates using the provided view matrix. Returns the resulting screen position as a vector.
Calculate Bounds
source2.calculate_bounds(vector: world_position, vector: mins, vector: maxs, matrix_4x4: view_matrix)Calculates a 3D object's bounding box into the 2D screen coordinates and returns the screen coordinates as a rectangle defined by its x, y, w, and h.
Last updated