public override List <ActorObj> CalculationHit(SkillData skilldata, GTargetInfo targetInfo) { float minDis = skilldata.MSV_AreaParam1 / 10.0f; float maxDis = skilldata.MSV_AreaParam2 / 10.0f; float w = skilldata.MSV_AreaParam3 / 10.0f; Vector3 pos = skilldata.IsAreaUseTarPos() ? targetInfo.m_vTarPos : targetInfo.m_vSrcPos; Vector3 dir = targetInfo.m_vAimDir; Vector3 center = pos + dir * ((minDis + maxDis) / 2); SRect sRect = new SRect(center, maxDis - minDis, w); List <ActorObj> pActorList = ActorMgr.GetAllActor(); if (pActorList.Count <= 0) { return(null); } List <ActorObj> list = new List <ActorObj>(); foreach (ActorObj actor in pActorList) { if (actor == m_pLocalPlayer) { continue; } ActorObj obj = (ActorObj)actor; if (obj.CollisionCom == null) { continue; } for (int i = 0; i < obj.CollisionCom.GetShapeCount(); i++) { SShapeData shp = obj.CollisionCom.GetShape(i); if (shp != null) { SSphere sTarSphere = new SSphere(shp.Pos, shp.r); if (GCollider.RectCollideCheck(sRect, sTarSphere, dir)) { list.Add(actor); break; } } } } return(list); }
public override List <ActorObj> CalculationHit(SkillData skilldata, GTargetInfo targetInfo) { float r = skilldata.MSV_AreaParam1 / 10.0f; float dis = skilldata.MSV_AreaParam2 / 10.0f; Vector3 pos = skilldata.IsAreaUseTarPos() ? targetInfo.m_vTarPos : targetInfo.m_vSrcPos; Vector3 dir = targetInfo.m_vAimDir; Vector3 spPos = pos + dir * dis; SSphere sSphere = new SSphere(spPos, r); List <ActorObj> pActorList = ActorMgr.GetAllActor(); if (pActorList.Count <= 0) { return(null); } List <ActorObj> list = new List <ActorObj>(); foreach (ActorObj actor in pActorList) { if (actor == m_pLocalPlayer) { continue; } if (actor.CollisionCom == null) { continue; } for (int i = 0; i < actor.CollisionCom.GetShapeCount(); i++) { SShapeData shp = actor.CollisionCom.GetShape(i); if (shp != null) { SSphere sTarSphere = new SSphere(shp.Pos, shp.r); if (GCollider.SphereCollideCheck(sSphere, sTarSphere, dir)) { list.Add(actor); break; } } } } return(list); }