Skip to content

Feature/wire-link#174

Open
Jiafeng-Xu-Aker wants to merge 2 commits into
Algoryx:mainfrom
Jiafeng-Xu-Aker:feature/wire-link
Open

Feature/wire-link#174
Jiafeng-Xu-Aker wants to merge 2 commits into
Algoryx:mainfrom
Jiafeng-Xu-Aker:feature/wire-link

Conversation

@Jiafeng-Xu-Aker

@Jiafeng-Xu-Aker Jiafeng-Xu-Aker commented Jun 9, 2026

Copy link
Copy Markdown

This PR adds end-to-end support for connecting two wires through a shared rigid body using
agxWire::Link and agxWire::ConnectingNode.

On the Unreal side this is exposed through a new UAGX_WireLinkComponent plus a new
user-creatable Connecting wire route node type. A wire can now route into a link body on one
side and another wire can route out from the opposite side, allowing tension to be transferred
through the intermediate rigid body.

The implementation covers the barrier layer, runtime component layer, route-node data model,
and editor details UI

User-facing changes

  • Adds UAGX_WireLinkComponent as the Unreal wrapper for agxWire::Link.
  • Exposes EWireNodeType::Connecting in the route-node type picker.
  • The wire side (WIRE_BEGIN / WIRE_END) is derived automatically from the node's position
    in the route array: a Connecting node at index 0 is the begin side; one at the last index
    is the end side. No per-node setting is required.
  • Adds a Radius setting on UAGX_WireLinkComponent that is applied to the generated
    connecting node after the link has been inserted into the wire route.
  • Render the connecting node yellow.

Implementation details

Barrier layer

  • Adds FWireLinkRef as the AGX ref wrapper for agxWire::Link.
  • Adds FWireLinkBarrier with support for:
    • native allocation from an existing rigid body,
    • registering wire/link connections,
    • inserting the link into a wire route, and
    • applying radius to the AGX-created connecting node after route insertion.
  • Extends FWireNodeBarrier with AllocateNativeConnectingNode for native type support.

Runtime layer

  • Adds UAGX_WireLinkComponent as a scene component that wraps the rigid body found by walking
    up the attachment hierarchy to the nearest UAGX_RigidBodyComponent.
  • Extends UAGX_WireComponent::CreateNative() with a Connecting route-node path that:
    • resolves the target body and body-local attachment position,
    • finds the UAGX_WireLinkComponent attached to that body,
    • derives the link side from the node's index (first → WIRE_BEGIN, last → WIRE_END),
    • connects the wire to the link at the derived side,
    • inserts the link into the wire route, and
    • optionally applies the link radius to the created connecting node.
  • Tracks connected wire components on the link component for runtime inspection.

Editor and serialization

  • Makes Connecting user-creatable by moving it before NUM_USER_CREATABLE.
  • Reuses the existing RigidBody and Frame route-node fields for connecting-node body lookup
    and local position.

Important design notes

  • UAGX_WireLinkComponent identifies its wrapped body from the component attachment hierarchy.
  • The connecting-node position comes from FWireRoutingNode::Frame, evaluated relative to the
    referenced rigid body, matching the existing Eye and BodyFixed patterns.
  • The link side is implicit: a Connecting node must be either the first or the last node in
    the route. First node → WIRE_BEGIN; last node → WIRE_END. A Connecting node placed
    anywhere else is an error that falls back to a Free node at BeginPlay.
  • agxSDK::Simulation has no add(agxWire::Link*) overload. The barrier-level
    Add/Remove(FWireLinkBarrier&) implementations are therefore intentional no-ops. The AGX link
    becomes active implicitly when the connected wires are added to the simulation.
  • Radius cannot be provided when AGX creates the connecting node through wire->add(link).
    The implementation therefore applies radius afterward via the link-managed connecting node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant