fix raycast for player

This commit is contained in:
Glence 2023-03-04 00:05:26 +08:00
parent ebf2bb8d85
commit daad6699f1
2 changed files with 1 additions and 7 deletions

View File

@ -28,11 +28,6 @@ public class PickAndThrow : Script
public bool throwItem = false;
private Vector3 prevTargetOffSet;
public GameObject silhouettePlayer;
public Renderable silhouettePlayerRend;
public GameObject silhouetteBag;
public Renderable silhouetteBagRend;
[Tooltip("Lenght of ray")]
public float rayDistance = 1;
@ -231,6 +226,7 @@ public class PickAndThrow : Script
if (pc != null)
{
Vector3 dirNor = pc.tranform.Forward;
dirNor = new Vector3(-dirNor.x, -dirNor.y, -dirNor.z);
Vector3 playerRayPos = pc.tranform.GlobalPosition;
playerRayPos.y += rayHeight;
dirNor.Normalise();

View File

@ -230,8 +230,6 @@ namespace SHADE
{
if (hitResult.distance < pivot.armLength)
{
SHLOG_INFO("WHAT CAMERA HIT: {}", hitResult.entityHit);
SHVec3 newOffset{ 0.0f,0.0f, 1.0f };
newOffset = SHVec3::RotateX(newOffset, -(SHMath::DegreesToRadians(pivot.GetPitch())));
newOffset = SHVec3::RotateY(newOffset, (SHMath::DegreesToRadians(pivot.GetYaw())));