protected void physStayOnWall() { var rc = new UnderRaycaster(ref posture, ref figure, this); var res = new RaycastHit(); if (rc.raycastUnder(out res)) { // 接地してた posture.rot = Quaternion.FromToRotation(rc.up, res.normal) * posture.rot; rb.MovePosition(res.point); } else { // 落下へ state.setPhysics(physFree); shiftToPhysicalMode(); } }
public bool raycastUnder(out RaycastHit hit) { return(r.raycastUnder(out hit)); }