Skip to main content

TransformMovementContext

A class in Root.Township, the global namespace.

A movement context that converts positions and rotations to and from a transform's local space. Built with new around an entity, using the entity's own transform or a given one.

Constructors​

MemberWhat it is
TransformMovementContext(NetworkEntity entity)Creates a TransformMovementContext from entity and transform.
TransformMovementContext(NetworkEntity entity, Transform transform)Creates a TransformMovementContext from entity and transform.

Fields​

1 private and internal field
MemberWhat it is
private Transform transformBacking field for Transform.

Properties​

MemberWhat it is
NetworkEntity Entity { get; }The entity this context belongs to.
IMovementContext MovementContext { get; }Returns itself, so it can be used as an IHasMovementContext.
Transform Transform { get; }The transform used as the local space.

Methods​

MemberWhat it is
Vector3 LocalToWorld(Vector3 local)Converts a local position or rotation to world space using the transform.
Quaternion LocalToWorld(Quaternion local)Converts a local position or rotation to world space using the transform.
Vector3 WorldToLocal(Vector3 world)Converts a world position or rotation to the transform's local space.
Quaternion WorldToLocal(Quaternion world)Converts a world position or rotation to the transform's local space.