Code Monkey home page Code Monkey logo

navmesh-lib's Introduction

[L4D2] NavMesh Library

This is a SourceMod Plugin that exposes some useful functions from the CNavMesh, TerrorNavMesh, CNavArea and TerrorNavArea classes.

API

methodmap CNavArea
{
    public native int GetAttributes();
    public native bool IsUnderwater();
    public native int GetCenter( float flVecCenterOut[3] );

    /*
     * Adds a new marker which is then used to flag certain areas as already checked,
     * usually used by the A* pathfinding algorithm.
     */
    public static native void MakeNewMarker();

    public native bool IsMarked();
    public native void Mark();
};

methodmap CNavMesh
{
    /*
     * Given a position, return the nav area that IsOverlapping and is *immediately* beneath it.
     */
    public static native CNavArea GetNavArea( float flVecPos[3], float flBeneathLimit = 120.0 );
};

methodmap TerrorNavArea < CNavArea
{
    /*
     * @param eTraverseType     (Optional) How this area is traversed.
     */
    public native TerrorNavArea GetNextEscapeStep( NavTraverseType& eTraverseType = view_as<NavTraverseType>( 0 ) );

    /*
     * Returns true if these conditions are met:
     *
     * Area is not blocked for the infected team.
     * Area doesn't have attribute NAV_MESH_CROUCH and NAV_MESH_JUMP flags.
     * Area doesn't have attribute NAV_TANK_ONLY and NAV_MOB_ONLY flags.
     * Area doesn't have spawn SPAWN_RESCUE_CLOSET, SPAWN_CHECKPOINT, SPAWN_PLAYER_START, and SPAWN_EMPTY flags.
     * Flow isn't broken (the area's flow distance away from the player start isn't negative).
     */
    public native bool IsValidForWanderingPopulation();

    property TerrorNavAreaVisibleToType m_fPotentiallyVisibleToSurvivorFlags
    {
        public native get();
    }

    public native int GetSpawnAttributes();
};

methodmap TerrorNavMesh < CNavMesh
{
    public static native float GetMaxFlowDistance();
};

Requirements

Supported Platforms

  • Windows
  • Linux

Supported Games

  • Left 4 Dead 2

navmesh-lib's People

Contributors

justin-chellah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.