Plush

Rope#

PlushEngine · Type index

Namespace: PlushEngine.Physics (using PlushEngine.Physics;)

A rope in a scene: RopeLine physics wrapped around the scene's static geometry, plus a tube mesh that draws it. The rope owns one generated object (a lit tube, rebuilt each Update); dispose it to remove the object. Gameplay drives the free end (a character, a hook) and reads Line to constrain it. Static bodies only for now.

public sealed class Rope : IDisposable

Members: Dispose · Line · Place · Rope · Samples · Update · Visual

Dispose#

public void Dispose();

Line#

public RopeLine Line { get; }

Place#

public void Place(Vector3 anchor, Vector3 end, float length);

Place both ends directly with no wrapping (a hook in flight): the rope is drawn straight between them.

Rope#

public Rope(RuntimeScene scene, Vector3 anchor, Vector3 end, float length, IReadOnlyList<RuntimeEntity>? ignore = null, float radius = .03f, int sides = 6, string color = "#6B4F2A");

Samples#

public int Samples { get; set; }

Initial value: 10

Update#

public void Update(Vector3 end);

Move the free end and update wraps and the drawn tube. The caller keeps the end inside the length with RopeLine.Constrain.

Visual#

public RuntimeEntity Visual { get; }

RopeLine · RuntimeEntity · RuntimeScene

Source#