func_pendulum Last edited 4 years ago2020-05-24 19:56:22 UTC

This article was converted from a previous version of TWHL and may need to be reviewed

  1. The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
  2. Some information may be out of date
  3. After the article is re-formatted and updated, remove this notice and the Review Required category.
  4. 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 Entity

This entity allows you to create an object that moves like a pendulum.

Attributes

Flags

Notes

1 Comment

Commented 7 months ago2024-03-11 14:22:23 UTC Comment #106061
Just posting it here as well for convenience:

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)
User posted image
where 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.
Note:
Make sure to set your calculator to use degrees, not radians

You must log in to post a comment. You can login or register a new account.