Skip to content

Feature request: Traceray natives for triggers #749

@jason-e

Description

@jason-e

There is currently no way to do point/ray/hull testing against trigger entities. Associated SourceMod traceray natives make use of IEngineTrace->TraceRay() and IEngineTrace->GetPointContents() which, at least according to the implementation found here, explicitly ignore trigger entities through the use of the partition mask PARTITION_ENGINE_SOLID_EDICTS which includes "every edict_t that isn't SOLID_TRIGGER or SOLID_NOT (and static props)".

The enginetrace function EnumerateEntities() (with triggers == true) could be used to at least find triggers along a given ray/rayhull. True "collision" testing would also require the use of enginetrace's ClipRayToEntity(). Whether these two functions should be exposed directly or used in some higher-level function(s) is not important as long as point/ray/hull testing is made possible for triggers.

It is technically already possible to "find" triggers by hooking trigger entity touch events and moving some entity through a given area until they are fired, however that is not a great solution as it is imprecise and cannot be done instantaneously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions