コード例 #1
0
    //Called to place a MovingColPoint to support moving colliders
    public override void PlaceMovingColPoint()
    {
        //MOVINGCOLPOINT, see CapsuleMovingColliderSolver for more details
        CEdgeCastInfo info = m_ControlledCollider.GetEdgeCastInfo();

        m_ControlledCollider.AddColPoint(info.GetEdgeTransform(), info.GetEdgePoint(), info.GetEdgeNormal());
    }
コード例 #2
0
    //Called whenever this module is started (was inactive, now is active)
    protected override void StartModuleImpl()
    {
        base.StartModuleImpl();
        //MOVINGCOLPOINT, see GroundedAnimatedAbilityModules for more details
        CEdgeCastInfo info = m_ControlledCollider.GetEdgeCastInfo();

        Transform transform = new GameObject().transform;

        transform.position = info.GetEdgePoint();
        transform.parent   = info.GetEdgeTransform();
        if (m_ReferencePoint == null)
        {
            m_ReferencePoint = new MovingColPoint();
        }
        m_ReferencePoint.m_Transform           = transform;
        m_ReferencePoint.m_PrevPoint           = transform.position;
        m_ReferencePoint.m_PrevRot             = transform.rotation;
        m_ReferencePoint.m_Normal              = info.GetEdgeNormal();
        m_ReferencePoint.m_PointRelativeToThis = m_ControlledCollider.GetCapsuleTransform().GetPosition() - info.GetEdgePoint();
    }