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.RigidTransform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.SpawnData, BaseEntity.NameFixup, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.SpawnTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.WorldOrigin, BaseEntity.WorldAngles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, 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, Scene, Model, GrenadeKind, ParticleSystem?, ParticleSystem?)
Creates a grenade projectile and its scene node; put it in the world with .
public CS2Projectile(EntitySystem system, Scene scene, Model model, CS2Projectile.GrenadeKind kind, ParticleSystem? detonationEffect, ParticleSystem? flightEffect = null)Parameters
system EntitySystem
scene Scene
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
Source 2 does it both ways, chosen per class by . By default the turn goes about the entity's own axes, so a brush authored on its side spins about its own up axis rather than the world's. The doors and other toggle brushes instead add the rate onto the QAngle components, as Source 1 always did. The two only differ for an entity the map already rotated.
SweepHull(PhysicsWorld?, 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(PhysicsWorld? physics, EntitySystem? entities, Vector3 from, Vector3 to)Parameters
physics PhysicsWorld?
entities EntitySystem?
from Vector3
to Vector3

