Feature/wire-link#174
Open
Jiafeng-Xu-Aker wants to merge 2 commits into
Open
Conversation
…m if the node is at the start or the end of routing node array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds end-to-end support for connecting two wires through a shared rigid body using
agxWire::LinkandagxWire::ConnectingNode.On the Unreal side this is exposed through a new
UAGX_WireLinkComponentplus a newuser-creatable
Connectingwire route node type. A wire can now route into a link body on oneside 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
UAGX_WireLinkComponentas the Unreal wrapper foragxWire::Link.EWireNodeType::Connectingin the route-node type picker.WIRE_BEGIN/WIRE_END) is derived automatically from the node's positionin 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.
Radiussetting onUAGX_WireLinkComponentthat is applied to the generatedconnecting node after the link has been inserted into the wire route.
Implementation details
Barrier layer
FWireLinkRefas the AGX ref wrapper foragxWire::Link.FWireLinkBarrierwith support for:FWireNodeBarrierwithAllocateNativeConnectingNodefor native type support.Runtime layer
UAGX_WireLinkComponentas a scene component that wraps the rigid body found by walkingup the attachment hierarchy to the nearest
UAGX_RigidBodyComponent.UAGX_WireComponent::CreateNative()with aConnectingroute-node path that:UAGX_WireLinkComponentattached to that body,WIRE_BEGIN, last →WIRE_END),Editor and serialization
Connectinguser-creatable by moving it beforeNUM_USER_CREATABLE.RigidBodyandFrameroute-node fields for connecting-node body lookupand local position.
Important design notes
UAGX_WireLinkComponentidentifies its wrapped body from the component attachment hierarchy.FWireRoutingNode::Frame, evaluated relative to thereferenced rigid body, matching the existing Eye and BodyFixed patterns.
the route. First node →
WIRE_BEGIN; last node →WIRE_END. A Connecting node placedanywhere else is an error that falls back to a Free node at BeginPlay.
agxSDK::Simulationhas noadd(agxWire::Link*)overload. The barrier-levelAdd/Remove(FWireLinkBarrier&)implementations are therefore intentional no-ops. The AGX linkbecomes active implicitly when the connected wires are added to the simulation.
wire->add(link).The implementation therefore applies radius afterward via the link-managed connecting node.