fix: Update HP move in scene a69.
This commit is contained in:
@@ -643,7 +643,6 @@ namespace BrewMonster
|
||||
//@note : additional handle something??? By Kuiwu[13/9/2005]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////@note : prevent moving to the invalid area. By Kuiwu[20/9/2005]
|
||||
@@ -724,22 +723,23 @@ namespace BrewMonster
|
||||
// pTrc.vEnd.y -= pTrc.fDeltaY;
|
||||
BrushTraceInfo trcInfo = new BrushTraceInfo();
|
||||
trcInfo.Init(pTrc.vStart, new A3DVECTOR3(0.0f, -pTrc.fDeltaY, 0.0f), pTrc.vExt);
|
||||
if (AABBCollideWithBrush(ref trcInfo))
|
||||
Vector3 hitPoint = new Vector3();
|
||||
if (AABBCollideWithBrush(ref trcInfo, ref hitPoint))
|
||||
{
|
||||
|
||||
// if (trcInfo.bStartSolid && (!RescueFromSolid(&trcInfo)))
|
||||
// {
|
||||
// pTrc.bSupport = true;
|
||||
// pTrc.vHitNormal = vTerrainNormal;
|
||||
// pTrc.vEnd = pTrc.vStart;
|
||||
// return false;
|
||||
// }
|
||||
if (trcInfo.bStartSolid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pTrc.vEnd = trcInfo.vStart + trcInfo.vDelta * trcInfo.fFraction;
|
||||
pTrc.vEnd.y += 0.05f; // need add delta Y for Support Plane when check with brush mask.
|
||||
pTrc.vEnd.y = hitPoint.y + pTrc.vExt.y + 0.1f;
|
||||
//if((pTrc.vEnd.y + 0.17f) < (hitPoint.y + pTrc.vExt.y + 0.1f))
|
||||
//{
|
||||
// pTrc.vEnd.y = hitPoint.y + pTrc.vExt.y + 0.1f; // need add delta Y for Support Plane when check with brush mask.
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// pTrc.vEnd.y += 0.17f;
|
||||
//}
|
||||
pTrc.vHitNormal = trcInfo.normal;
|
||||
|
||||
float fUp = pTrc.vExt.y;
|
||||
@@ -1005,6 +1005,41 @@ namespace BrewMonster
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool AABBCollideWithBrush(ref BrushTraceInfo brushTraceInfo, ref Vector3 hitPoint)
|
||||
{
|
||||
Vector3 vExt = EC_Utility.ToVector3(brushTraceInfo.vExtents);
|
||||
Vector3 vStart = EC_Utility.ToVector3(brushTraceInfo.vStart);
|
||||
Vector3 vDelta = EC_Utility.ToVector3(brushTraceInfo.vDelta);
|
||||
Vector3 dir = vDelta;
|
||||
int countHits = 0;
|
||||
float num = 10f;
|
||||
//Quaternion quaternion = EC_Game.GetGameRun().GetWorld().GetPlayerMan().GetHostPlayer().transform.rotation;
|
||||
Vector3[] arrVExt = new Vector3[5] {
|
||||
vExt
|
||||
,new Vector3(vExt.x / num, vExt.y, vExt.z),
|
||||
new Vector3(vExt.x, vExt.y / num, vExt.z),
|
||||
new Vector3(vExt.x, vExt.y, vExt.z / num),
|
||||
vExt / num
|
||||
};
|
||||
for (int i = 0; i < arrVExt.Length; i++)
|
||||
{
|
||||
countHits = Physics.BoxCastNonAlloc(vStart, arrVExt[i], dir.normalized, hits, Quaternion.identity, vDelta.magnitude, BrushMask);
|
||||
if (countHits > 0)
|
||||
{
|
||||
if (hits[0].distance > 0.0009f)
|
||||
{
|
||||
brushTraceInfo.fFraction = (hits[0].distance) / vDelta.magnitude;
|
||||
brushTraceInfo.normal = EC_Utility.ToA3DVECTOR3(hits[0].normal);
|
||||
hitPoint = hits[0].point;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
brushTraceInfo.normal = new A3DVECTOR3(0f);
|
||||
brushTraceInfo.fFraction = 100f;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void OnAirMove(ref ON_AIR_CDR_INFO awmInfo)
|
||||
{
|
||||
//assert(0 && "Not ready yet");
|
||||
|
||||
Reference in New Issue
Block a user