private RailwayPhysicsLinkData GetLinkData(RailPhysicsNode other) { return(new RailwayPhysicsLinkData { FromQualifier = Math.Min(_target.Entity.EntityId, other._target.Entity.EntityId), ToQualifier = Math.Max(_target.Entity.EntityId, other._target.Entity.EntityId) }); }
public void Unlink(RailPhysicsNode other) { if (!IsAuthority) { return; } var selfRoot = _rootRef?.RootParent?.Entity; var otherRoot = other._rootRef?.RootParent?.Entity; if (selfRoot == null || otherRoot == null) { return; } var linkData = GetLinkData(other); _target.Scene.RemoveLink <RailwayPhysicsGroup, MyEntity, RailwayPhysicsLinkData>(selfRoot, otherRoot, linkData); }
public BogieComponent() { PhysicsNode = new RailPhysicsNode(this); }