public bool LBoxRay(out RaycastHit hitInfo) { Vector3 harfSize = mRayConfig.BoxcastSize / 2.0f; Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.CenterOffset); return(Physics.BoxCast(from, harfSize, LTo, out hitInfo, mTransform.rotation, mRayConfig.LrLength)); }
public void DrawGizmos() { Gizmos.color = Color.red; Gizmos.DrawRay(RayMethod.MakeFrom(mTransform, mRayConfig.RfOffset), mRFTo * mRayConfig.LRLength); Gizmos.DrawRay(RayMethod.MakeFrom(mTransform, mRayConfig.LfOffset), mLFTo * mRayConfig.LRLength); GizmosBoxcast(); }
/// <summary>正面方向ボックスレイ</summary> public bool ForwardBoxCast(out RaycastHit hitInfo) { Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.ForwardOffset); Vector3 harf = mRayConfig.BoxSize / 2.0f; return(Physics.BoxCast(from, harf, mTransform.forward, out hitInfo, mTransform.rotation, mRayConfig.ForwardBoxcastLength)); }
public void GizmosBoxcast() { RaycastHit hitInfo; ForwardBoxCast(out hitInfo); Gizmos.color = Color.cyan; Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.ForwardOffset); float dis = (hitInfo.distance <= 0f ? mRayConfig.ForwardBoxcastLength : hitInfo.distance); Gizmos.DrawWireCube((from) + (mTransform.forward * dis), mRayConfig.BoxSize); }
public void DrawRayGizmos() { Gizmos.color = Color.red; if (mRayConfig == null) { return; } RaycastHit hitInfo; RBoxRay(out hitInfo); Gizmos.DrawWireCube(RayMethod.MakeFrom(mTransform, mRayConfig.CenterOffset) + (RTo * (hitInfo.distance <= 0f ? mRayConfig.LrLength : hitInfo.distance)), mRayConfig.BoxcastSize); LBoxRay(out hitInfo); Gizmos.DrawWireCube(RayMethod.MakeFrom(mTransform, mRayConfig.CenterOffset) + (LTo * (hitInfo.distance <= 0f ? mRayConfig.LrLength : hitInfo.distance)), mRayConfig.BoxcastSize); }
/// <summary>左斜め前方向レイ</summary> public bool LFRaycast(out RaycastHit hitInfo) { Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.LfOffset); return(Physics.Raycast(from, mLFTo, out hitInfo, mRayConfig.LRLength)); }