cphysics_query_interface

Usage:

Usage: game.physics_query_interface:{method}

This type encapsulates all tracing functionalities.

trace_ray

Function

Performs a regular trace ray call. Skips local player.

Arguments

Name

Type

Description

ray

The ray/shape

from

vector

The starting position

to

vector

The ending position

Returns

Type

Description

The resulting trace object

Example

local ray = ray_t()
local from = vector(0, 0, 0)
local to = vector(100, 100, 100)

local trace = game.physics_query_interface:trace_ray(ray, from, to)

trace_movement

Function

Performs a trace ray call using the player movement mask. Skips local player.

Arguments

Name

Type

Description

ray

The ray/shape

from

vector

The starting position

to

vector

The ending position

Returns

Type

Description

The resulting trace object

Example


trace_grenade

Function

Performs a trace call using the grenade mask, as a line. Doesn't use a custom ray.

Arguments

Name

Type

Description

from

vector

The starting position

to

vector

The ending position

thrower

base_entity

The entity throwing the grenade, gets skipped

ignore_breakable

boolean

Ignores any breakable objects if true

Returns

Type

Description

The resulting trace object


trace_grenade_hull

Function

Performs a trace call using the grenade mask, as a hull. Doesn't use a custom ray.

Arguments

Name

Type

Description

from

vector

The starting position

to

vector

The ending position

thrower

base_entity

The entity throwing the grenade, gets skipped

Returns

Type

Description

The resulting trace object

Last updated