Skip to main content

InteractArguments

A struct in Root.Township, the global namespace.

The network message sent when a hand starts holding an entity: the held entity, its velocity and pose, the hand's pose, and force flags.

Constructors​

MemberWhat it is
InteractArguments(Interactor holder, NetworkEntity held, bool isForced = false, bool isForcingHold = false)Creates an InteractArguments from interactorTarget, held, heldVelocity, heldAngularVelocity, isForced and isForcingHold.
InteractArguments(NetworkEntity interactor, NetworkEntity held, Vector3 velocity, Vector3 angularVelocity, bool isForced = false, bool isForcingHold = false)Creates an InteractArguments from interactorTarget, held, heldVelocity, heldAngularVelocity, isForced and isForcingHold.
1 private and internal constructor
MemberWhat it is
private InteractArguments(Transform interactorTarget, NetworkEntity held, Vector3 heldVelocity, Vector3 heldAngularVelocity, bool isForced, bool isForcingHold)Creates an InteractArguments from interactorTarget, held, heldVelocity, heldAngularVelocity, isForced and isForcingHold.

Fields​

MemberWhat it is
Vector3 angularVelocityAngular velocity of the held entity.
Vector3 interactorPositionWorld position of the hand (its wrist).
Quaternion interactorRotationWorld rotation of the hand.
bool isForcedBacking field for IsForced.
bool isForcingHoldBacking field for IsForcingHold.
Vector3 positionWorld position of the held entity.
Quaternion rotationWorld rotation of the held entity.
uint targetBacking field for Target.
Vector3 velocityVelocity of the held entity, including the player's movement when built from an Interactor.
7 private and internal fields
MemberWhat it is
private static readonly Vector3 AngularVelocityMaxUpper bound used when compressing angular velocity for the network.
private static readonly Vector3 AngularVelocityMinLower bound used when compressing angular velocity for the network.
private const float AngularVelocityPrecisionPrecision (0.001) used when compressing angular velocity.
private Chunk chunkChunk the positions are sent relative to: the held entity's chunk on the server, the local player's chunk on clients.
private static readonly Vector3 VelocityMaxUpper bound (100 per axis) used when compressing velocity.
private static readonly Vector3 VelocityMinLower bound (-100 per axis) used when compressing velocity.
private const float VelocityPrecisionPrecision (0.001) used when compressing velocity.

Properties​

MemberWhat it is
bool IsAccessingScore { get; }Always true, so the receiver checks the grab is valid and logs an error if not.
bool IsForced { get; }Whether the interaction was forced.
bool IsForcingHold { get; }Whether to force the hold.
uint Target { get; }Identifier of the held entity.

Methods​

MemberWhat it is
void Serialize(IPlayer player, Stream stream)Writes or reads the target, velocities, poses (relative to a chunk) and flags.
static void SerializeLinearAngularVelocity(Stream stream, ref Vector3 velocity, ref Vector3 angularVelocity)Writes or reads a velocity and angular velocity with the same limits.

Used in​

Members of other types that take, return or hold a InteractArguments: