@prototwin/air-gun

1.0.0PublicPublished about 2 months ago

Simulates a pressurized nozzle that sprays an air jet within a configurable cone of effect.

Latest Version: 1.0.0

Size: 4 KB

Publisher: ProtoTwin (contact@prototwin.com)

README.md

Air Gun

The AirGun component simulates a pressurized nozzle that sprays an air jet within a configurable cone of effect. It casts rays to find where this jet would strike surfaces and estimates how much of the jet's total thrust those hit points should receive. It uses a turbulent jet spreading model with Gaussian radial decay, assuming compressible flow conditions at the nozzle.

Properties

  • Origin: The center of the nozzle.
  • Direction: The direction in which air is ejected from the nozzle.
  • Rays: The number of rays to cast.
  • Angle: The angle for the cone of effect.
  • Nozzle Diameter: The diameter of the nozzle opening.
  • Range: The maximum range for the air jet's cone of effect.
  • Layer: The physics layer to assign to the rays, which can be used for filtering.
  • State: Whether the valve is opened.
  • Pressure: The absolute pressure at the nozzle.

Detail

Increase the number of rays for greater physical accuracy, at the expense of increased computational cost. The component will always cast a ray down the center of the cone. All other rays are randomly sampled from the cone of effect each frame.

IO

The component has the following IO:

  • State: (Input) Whether the valve is opened.
  • Pressure: (Input) The absolute pressure at the nozzle.