Esempio n. 1
0
    public static void SetupSim(string _instanceName, Vector3 _side, Vector3 _fwd)
    {
        var inst = RVOUnityMgr.GetInstance(_instanceName);

        inst.m_side = _side;
        inst.m_fwd  = _fwd;
    }
Esempio n. 2
0
    public static void AddObstacle(string _instanceName, Vector3 _pos, Vector3 _extents)
    {
        var inst = RVOUnityMgr.GetInstance(_instanceName);

        inst.m_obstacles.Add(new RVOUnityInstance.RVOObstacle(_pos, _extents));
        inst.m_forceRefresh = true;
    }
Esempio n. 3
0
 public static void CheckMe()
 {
     if (Me == null)
     {
         var go = new GameObject("RVOMgr");
         Me = go.AddComponent <RVOUnityMgr>();
     }
 }
Esempio n. 4
0
 public void Add()
 {
     if (m_instance == null)
     {
         m_instance = RVOUnityMgr.GetInstance(m_instanceName);
     }
     m_id = m_instance.m_instance.addAgent(transform.position.XZ());
     if (m_radius != 0)
     {
         m_instance.m_instance.setAgentRadius(m_id, m_radius);
     }
     ClearVelocity();
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        SetUpRoute();
        m_prevWaypoint     = m_currentWaypoint;
        m_desiredDirection = m_direction = GlobalScript.GetDirection(transform.position, m_currentWaypoint);
        m_animationScript  = GetComponent <WNS_AnimationControllerScript> ();
        m_rvoScript        = GetComponent <RVOUnity> ();
        m_maxSpeed         = m_speed;
        if (m_animationScript == null)
        {
            print("Animation script it detached");
        }

        if (m_rvoScript == null)
        {
            print("RVO script it detached");
        }
        else
        {
            RVOUnityMgr.GetInstance("").SetCheckMoveFn(HandleCheckMoveFn);
        }
    }
Esempio n. 6
0
    public static int NumObstacles(string _instanceName)
    {
        var inst = RVOUnityMgr.GetInstance(_instanceName);

        return(inst.m_obstacles.Count);
    }
Esempio n. 7
0
 public static bool InstanceExists(string _instanceName)
 {
     return(RVOUnityMgr.InstanceExists(_instanceName));
 }
Esempio n. 8
0
    public static void SetMoveCheck(string _instanceName, RVOUnityInstance.CheckMoveFn _fn)
    {
        var inst = RVOUnityMgr.GetInstance(_instanceName);

        inst.SetCheckMoveFn(_fn);
    }
Esempio n. 9
0
    public static void SetSimDefaults(string _instanceName, float _neighbourDistance, int _maxNeighbours, float _defaultRadius, float _maxSpeed)
    {
        var inst = RVOUnityMgr.GetInstance(_instanceName);

        inst.m_instance.setAgentDefaults(_neighbourDistance, _maxNeighbours, 10.0f, 10.0f, _defaultRadius, _maxSpeed, new RVO.Vector2());
    }