SwiftlyS2

TraceParamsBuilder

Class TraceParamsBuilder

Namespace: SwiftlyS2.Shared.Trace

Assembly: SwiftlyS2.CS2.dll

Fluent builder for TraceParams.

public sealed class TraceParamsBuilder

Inheritance

Inherited Members

Constructors

TraceParamsBuilder()

public TraceParamsBuilder()

TraceParamsBuilder(TraceParams?)

public TraceParamsBuilder(TraceParams? seed)
Parameters

Methods

Build()

public TraceParams Build()
Returns

ForceHitEverything(bool)

Force the trace to hit everything.

public TraceParamsBuilder ForceHitEverything(bool enabled = true)
Parameters
Returns

HitSolid(bool)

Whether the trace should report solid hits.

public TraceParamsBuilder HitSolid(bool enabled = true)
Parameters
Returns

HitSolidRequiresGenerateContacts(bool)

Whether the trace should report hits requiring contact generation.

public TraceParamsBuilder HitSolidRequiresGenerateContacts(bool enabled = true)
Parameters
Returns

HitTrigger(bool)

Whether the trace should report trigger hits.

public TraceParamsBuilder HitTrigger(bool enabled = true)
Parameters
Returns

IgnoreDisabledPairs(bool)

Whether disabled collision pairs should be ignored.

public TraceParamsBuilder IgnoreDisabledPairs(bool enabled = true)
Parameters
Returns

IgnoreEntities(IEnumerable<CEntityInstance>)

Entities that should be ignored by the trace.

public TraceParamsBuilder IgnoreEntities(IEnumerable<CEntityInstance> entities)
Parameters
Returns

IgnoreEntity(CEntityInstance)

Entities that should be ignored by the trace.

public TraceParamsBuilder IgnoreEntity(CEntityInstance entity)
Parameters
Returns

IgnoreIfBothInteractWithHitboxes(bool)

Whether hitboxes should be ignored when both sides interact with hitboxes.

public TraceParamsBuilder IgnoreIfBothInteractWithHitboxes(bool enabled = true)
Parameters
Returns

IgnoreOwner(CEntityInstance)

Entity owners that should be ignored by the trace.

public TraceParamsBuilder IgnoreOwner(CEntityInstance owner)
Parameters
Returns

IgnoreOwners(IEnumerable<CEntityInstance>)

Entity owners that should be ignored by the trace.

public TraceParamsBuilder IgnoreOwners(IEnumerable<CEntityInstance> owners)
Parameters
Returns

InteractAs(MaskTrace)

Interaction mask for "as" behavior.

public TraceParamsBuilder InteractAs(MaskTrace flags)
Parameters
Returns

InteractExclude(MaskTrace)

Interaction mask to exclude.

public TraceParamsBuilder InteractExclude(MaskTrace flags)
Parameters
Returns

InteractWith(MaskTrace)

Interaction mask to include.

public TraceParamsBuilder InteractWith(MaskTrace flags)
Parameters
Returns

RemoveInteractAs(MaskTrace)

Interaction mask for "as" behavior.

public TraceParamsBuilder RemoveInteractAs(MaskTrace flags)
Parameters
Returns

RemoveInteractExclude(MaskTrace)

Interaction mask to exclude.

public TraceParamsBuilder RemoveInteractExclude(MaskTrace flags)
Parameters
Returns

RemoveInteractWith(MaskTrace)

Interaction mask to include.

public TraceParamsBuilder RemoveInteractWith(MaskTrace flags)
Parameters
Returns

WithCapsuleRay(Vector, Vector, float)

public TraceParamsBuilder WithCapsuleRay(Vector centerA, Vector centerB, float radius)
Parameters
Returns

WithCollisionGroup(CollisionGroup)

Collision group used by the trace.

public TraceParamsBuilder WithCollisionGroup(CollisionGroup collisionGroup)
Parameters
Returns

WithDetailLayers(ushort, byte)

Included detail layers and target detail layer used by native query shape attributes.

public TraceParamsBuilder WithDetailLayers(ushort includedDetailLayers, byte targetDetailLayer = 0)
Parameters
  • includedDetailLayers ushort
  • targetDetailLayer byte
Returns

WithHierarchyIds(params ushort[])

Optional hierarchy ids used by the native query shape attributes (max 2 values used).

public TraceParamsBuilder WithHierarchyIds(params ushort[] hierarchyIds)
Parameters
Returns

WithHullRay(Vector, Vector)

public TraceParamsBuilder WithHullRay(Vector mins, Vector maxs)
Parameters
Returns

WithInteraction(MaskTrace, MaskTrace, MaskTrace)

Interaction mask to include/exclude and interaction mask for "as" behavior.

public TraceParamsBuilder WithInteraction(MaskTrace interactWith, MaskTrace interactExclude = MaskTrace.Empty, MaskTrace interactAs = MaskTrace.Empty)
Parameters
Returns

WithIterateEntities(bool)

Indicates whether entity iteration is enabled for custom filtering.

public TraceParamsBuilder WithIterateEntities(bool iterateEntities)
Parameters
  • iterateEntities bool
Returns

WithLineRay(Vector, float)

public TraceParamsBuilder WithLineRay(Vector startOffset, float radius = 0)
Parameters
Returns

WithLineRay()

public TraceParamsBuilder WithLineRay()
Returns

WithObjectQuery(RnQueryObjectSet)

Which object groups should be included by the query.

public TraceParamsBuilder WithObjectQuery(RnQueryObjectSet objectQuery)
Parameters
Returns

WithRay(in Ray_t)

public TraceParamsBuilder WithRay(in Ray_t ray)
Parameters
Returns

WithShouldHitEntity(Func<CEntityInstance, bool>?)

Optional callback to decide whether an entity should be hit.

public TraceParamsBuilder WithShouldHitEntity(Func<CEntityInstance, bool>? shouldHitEntity)
Parameters
Returns

WithSphereRay(Vector, float)

public TraceParamsBuilder WithSphereRay(Vector center, float radius)
Parameters
Returns

On this page