Class FuncRotating
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
func_rotating. A brush that spins about one axis at up to maxspeed degrees per second, either snapping to speed or ramping up and down against fanfriction.
public sealed class FuncRotating : BaseModelEntityInheritance
object ← BaseEntity ← BaseModelEntity ← FuncRotating
Inherited Members
BaseModelEntity.Solid, BaseModelEntity.ModelNode, BaseModelEntity.Physics, BaseModelEntity.LoadedModel, BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.RigidTransform, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.SpawnData, BaseEntity.NameFixup, BaseEntity.SpawnGroup, 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.IsShown, 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)
Remarks
The speed ramp is a chain of move-done callbacks 0.1s apart (SpinUpMove / SpinDownMove) that hand over to RotateMove at the target speed.
Hammer's "X Axis" sets roll and its "Y Axis" sets pitch, and with neither set the brush yaws about world Z. The mismatch is deliberate, so maps rotate the way they do in game.
The brush is solid unless "Not Solid" is set. The "Fan Pain" damage flag is not simulated.
Sound volume follows the speed, but the pitch stays fixed: in game the sample is wound from 30% to 100% pitch during spin-up, which the sound player cannot do.
Constructors
FuncRotating(EntitySystem, EntitySpawnInfo)
Initializes a func_rotating from its keyvalues.
public FuncRotating(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
FanFriction
Gets the ramp friction, fanfriction as a fraction.
public float FanFriction { get; }Property Value
float
IsPusher
A turning brush shoves the player rather than swallowing them.
protected override bool IsPusher { get; }Property Value
bool
IsReversed
Gets whether the Reverse input flipped the spin direction.
public bool IsReversed { get; }Property Value
bool
IsUnblockableByPlayer
Gets whether the player can never block this pusher: the player is moved the whole way, through the world if need be, and the pusher keeps going.
protected override bool IsUnblockableByPlayer { get; }Property Value
bool
MaxSpeed
Gets the top rotation speed in degrees per second.
public float MaxSpeed { get; }Property Value
float
MoveAngles
Gets the axis to rotate about, as a QAngle direction.
public Vector3 MoveAngles { get; }Property Value
SoundName
Gets the sound played while the brush turns, the message keyvalue.
public string? SoundName { get; }Property Value
string?
Speed
Gets the current rotation speed in degrees per second; negative spins in reverse.
public float Speed { get; }Property Value
float
TargetSpeed
Gets the speed being ramped towards.
public float TargetSpeed { get; }Property Value
float
Volume
Gets the volume the sound reaches at full speed, 0 to 1. Authored as volume, 0 to 10.
public float Volume { get; }Property Value
float
Methods
MoveDone()
Runs when BaseEntity.MoveDoneTime comes due, after the tick's movement was applied.
public override void MoveDone()OnRemove()
Called as the entity leaves the world, before its nodes leave the scene. Release anything the entity started here, such as a playing sound.
protected override void OnRemove()PhysicsSimulate(float)
Integrates this tick's movement: advances BaseEntity.Origin by BaseEntity.Velocity and turns by BaseEntity.AngularVelocity.
protected override void PhysicsSimulate(float tickInterval)Parameters
tickInterval float
Remarks
Turning is chosen per class by BaseEntity.TurnsByAngleComponents. By default it is about the entity's own axes, so a brush authored on its side spins about its own up axis. Doors and other toggle brushes add the rate onto the QAngle components instead. The two only differ for an entity the map already rotated.
SetTargetSpeed(float)
Sets the speed in degrees per second to ramp towards, or jumps straight to it when the brush does not accelerate. The sign comes from the reverse state, not from the speed passed in.
public void SetTargetSpeed(float speed)Parameters
speed float
Spawn()
Sets up the entity (model, class keyvalues, first think). Called once its spawn group has created all of its entities, after its move parent has spawned.
public override void Spawn()Remarks
An override calls this first: it builds the node from BaseEntity.CreateRootNode() and snaps the entity onto its parent's attachment, which the rest of the override reads.
Think()
Toggles on a brush that spawned with StartOn; the only think this entity schedules.
public override void Think()Toggle()
Starts the brush if it is stopped, stops it if it is spinning.
public void Toggle()
