Class CS2Projectile
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
A thrown CS2 grenade. Created at runtime by the viewmodel rather than from a map, simulated on the entity tick, and drawn through the model and effect nodes it owns.
public sealed class CS2Projectile : BaseEntityInheritance
object ← BaseEntity ← CS2Projectile
Inherited Members
BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.ParentTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.InPlayableWorld, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.AngleMod(float)
Constructors
CS2Projectile(EntitySystem, Model, GrenadeKind, ParticleSystem?, ParticleSystem?)
Creates a grenade projectile and its scene node; put it in the world with .
public CS2Projectile(EntitySystem system, Model model, CS2Projectile.GrenadeKind kind, ParticleSystem? detonationEffect, ParticleSystem? flightEffect = null)Parameters
system EntitySystem
model Model
kind CS2Projectile.GrenadeKind
detonationEffect ParticleSystem?
flightEffect ParticleSystem?
Fields
HullHalfExtents
The grenade's collision hull half extents.
public static readonly Vector3 HullHalfExtentsField Value
Sounds
Every sound event a grenade can play, for pre-caching.
public static readonly string[] SoundsField Value
string[]
Properties
InFlight
Gets whether the grenade is on its way and has not detonated.
public bool InFlight { get; }Property Value
Kind
Gets which grenade this is.
public CS2Projectile.GrenadeKind Kind { get; }Property Value
Live
Gets whether the grenade has been thrown and not finished its effect yet.
public bool Live { get; }Property Value
Position
Gets the position the grenade is drawn at this frame.
public Vector3 Position { get; }Property Value
Methods
Launch(Vector3, Vector3, BaseEntity?)
Throws (or re-throws, for a pooled instance) the grenade.
public void Launch(Vector3 origin, Vector3 velocity, BaseEntity? thrower)Parameters
origin Vector3
velocity Vector3
thrower BaseEntity?
PhysicsSimulate(float)
Integrates this tick's movement, advancing by and turning by .
protected override void PhysicsSimulate(float tickInterval)Parameters
tickInterval float
Remarks
The turn goes about the entity's own axes, not onto the QAngle components. Source 1 adds the components (physics_main.cpp: angles += GetLocalAngularVelocity() * movetime), Source 2 turns the body, and these are Source 2 maps. The two only differ for an entity the map already rotated, such as a brush authored on its side, which would otherwise yaw about the world's up axis.
SweepHull(Rubikon?, EntitySystem?, Vector3, Vector3)
Sweeps the grenade hull through the world and the brush entities, backing the hit off the surface.
public static Rubikon.TraceResult SweepHull(Rubikon? physics, EntitySystem? entities, Vector3 from, Vector3 to)Parameters
physics Rubikon?
entities EntitySystem?
from Vector3
to Vector3

