This article's documentation is for anything that uses the Source engine. Click here for more information.

env_quadraticbeam

From Valve Developer Community
Revision as of 05:31, 19 August 2024 by Nescius (talk | contribs)
Jump to navigation Jump to search
English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the FGD by default.
It should not be put directly in a map because it is only configurable via code or vscript.
C++ Class hierarchy
CEnvQuadraticBeam
CPointEntity
CBaseEntity
C++ effects.cpp
C++ Class hierarchy
client side
C_QuadraticBeam
C_BaseEntity
C++ c_effects.cpp

env_quadraticbeam is an entity available in all Source Source games. Essentially, it is a duplicate of beam entity, but with ability to use quadratic equation, so it can use an arc form.

Fields

m_targetPosition <FIELD_POSITION_VECTOR>

END point

m_controlPosition <FIELD_POSITION_VECTOR>

CONTROL point (see picture)

m_scrollRate <FIELD_FLOAT>

Must be value between -4, 4

m_flWidth <FIELD_FLOAT>


Notable KIO

KeyValues

Origin (origin) <vector>
Start point of the beam

Inputs

Color <color255RedirectInput/color32>
Changes color
Quadraticbeam.jpg

Spawning via vscript example

function SpawnQuadBeam(start, end, control, color="255 0 0", model="sprites/laserbeam.spr") {
    PrecacheModel(model);

    local ent = SpawnEntityFromTable("env_quadraticbeam", {
        origin = start
    })

    NetProps.SetPropVector(ent, "m_targetPosition", end)
    NetProps.SetPropVector(ent, "m_controlPosition", control)
    NetProps.SetPropFloat(ent, "m_scrollRate", 2)
    NetProps.SetPropFloat(ent, "m_flWidth", 5)

    DoEntFire("!self", "color", color, 0, null, ent)

    ent.SetModel(model);
}

See Also