Craig Martin

(Official) LUA Scripting Documentation

intersect_frustum

Frustum intersection query.


Spec:

intersect_frustum(
	double x1,
	double y1,
	double z1,
	double x2,
	double y2,
	double z2,
	long fov,
	bool players,
	bool npcs,
	bool display)

Parameters

Returns


The context target is set as the closest actor inside the frustum


Example

local dir = vector3(get_view_dir())
local near = vector3(get_eye_pos()) + (dir * 0.2)
local far = near + (dir * 50)
if intersect_frustum(near.x,near.y,near.z,far.x,far.y,far.z,60)
then
set_context("target")
add_health_effect(-10)
end

Incomplete

This documentation is incomplete


back