Advertisement
Guest User

Untitled

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