Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Note you could extend ShellHandRayPointer if you wanted the beam bending,
- // however configuring that pointer requires careful setup of asset.
- public class HL1HandRay : LinePointer
- {
- public override Quaternion Rotation
- {
- get
- {
- // Set rotation to be line from head to head, rotated a bit
- float sign = Controller.ControllerHandedness == Handedness.Right ? -1f : 1f;
- return Quaternion.Euler(0, sign * 35, 0) * Quaternion.LookRotation(Position - CameraCache.Main.transform.position, Vector3.up);
- }
- }
- // We cannot use the base IsInteractionEnabled
- // Because HL1 hands are always set to have their "IsInPointing pose" field as false
- // You may want to do more thorough checks here, following BaseControllerPointer implementation
- public override bool IsInteractionEnabled => IsFocusLocked || IsTracked;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement