This article was converted from a previous version of TWHL and may need to be reviewed
- The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
- Some information may be out of date
- After the article is re-formatted and updated, remove this notice and the Review Required category.
- Some older articles are no longer useful, or they duplicate information from other pages. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
Brush EntityThis entity allows you to create an object that moves like a pendulum.
Attributes
- Name (targetname) - Property used to identify entities.
- Render FX (renderfx) - Gives objects special render effects. Think of it as modifying whatever the Render Mode puts out. The options are as follows:
[list]
[li]0 = Normal
- 1 = Slow Pulse
- 2 = Fast Pulse
- 3 = Slow Wide Pulse
- 4 = Fast Wide Pulse
- 5 = Slow Fade Away
- 6 = Fast Fade Away
- 7 = Slow Become Solid
- 8 = Fast Become Solid
- 9 = Slow Strobe
- 10 = Fast Strobe
- 11 = Faster Strobe
- 12 = Slow Flicker
- 13 = Fast Flicker
- 14 = Constant Glow
- 15 = Distort
- 16 = Hologram (Distort and Fade)[/li]
[li]Render Mode (rendermode) - Controls the type of rendering that is used for an object. Options are:
- 0 = Normal
- 1 = Color
- 2 = Texture
- 3 = Glow
- 4 = Solid
- 5 = Additive[/li]
[li]Pitch Yaw Roll (angles) - Sets the pitch (up / down), yaw (left / right) and roll (bank) respectively. The compass in WorldCraft / Hammer corresponds to Yaw. The settings are not always (or not all) used.[/li]
[li]Global Entity Name (globalname)[/li]
[li]FX Amount (renderamt)[/li]
[li]FX Color (rendercolor)[/li]
[li]ZHLT Lightflags (zhlt_lightflags)[/li]
[li]Light Origin Target (light_origin)[/li]
[li]Speed (speed) - Speed of movement of the pendulum.[/li]
[li]Distance (distance) - Distance in degrees the pendulum will swing. Negative values reverse the direction.[/li]
[li]Damping (damp) - If you specify a value here the pendulum will slowly narrow its movement until it stops moving. It will end in the middle of it's swing, so if you specified 90 degrees as its distance, it will stop at the 45 degree position. Range: 0 - 1000.[/li]
[li]Damage inflicted when blocked (dmg) - When movement is blocked by the player, he will receive this amount of damage.[/li]
[li]Minimum light level (_minlight)[/li]
[/list]
Flags
- Start on (1)
- Passable (8) - Makes the pendulum non-soild.
- Auto-return (16) - If this is enabled it will cause the pendulum to return to its start position when triggered.
- X-axis (64) - If enabled, the swing will be in the X axis.
- Y-axis (128) - If enabled, the swing will be in the Y axis.
- Not in Deathmatch (2048)
Notes
- Swing defaults to the Z axis if neither of the axis flags is enabled.
- Use this entity to make broken lights and grandfather clocks.
Linear Pendulum trick
If you want to simulate a linear pendulum (e.g. a weight on a spring that bobs up-and-down or side-to-side) you can do so by placing the ORIGIN brush at a distance far away from the pendulum.To find the values to be given to the func_pendulum for a given length of oscillation you can use the equation
A = 2 × sin⁻¹(h / d)
h
is how far from the center the pendulum should oscillate (half the total distance),d
is how far the center of the ORIGIN is from the center of the pendulum,and
A
is the resulting angle we will use for Distance (distance).To make sure it oscillates properly we also need to set negative half
A
to Pitch Yaw Roll (angles) in the appropriate axis.As for the Speed (speed) you'd want a value that's near
A
, otherwise it'll move too fast (as the origin is so far away, small changes in the angle results in great changes in position of the pendulum).As an example, let's say we have a pendulum we want to move up-and-down by 32 units in the Y/Z plane. We create our pendulum and set the ORIGIN brush to be 7300 units away along the Y axis and we use the equation to find
A = 2 × sin⁻¹(32 / 7300) ≈ 0.5°
.So for our func_pendulum we set Distance to 0.5, Pitch Yaw Roll to
0 0 -0.25
, Speed to 0.2, and we set the Start on and X-axis flags.