core.libraries.thirdparty.niknaks.modules.sh_bsp_leafs

(no description)

Functions

AABBInLeafs(iNode, point, point2, add)

View source »

Returns a list of leafs within the given two positions.

Parameters

  • iNode number optional

  • point Vector

  • point2 Vector

  • add number optional

Returns

DebugRender(col)

View source »

A simple debug-render function that renders the leaf

Parameters

  • col Color

DistToSqr(position)

View source »

Roughly returns the distance from leaf to the given position.

Parameters

  • position Vector

Returns

  • number

Distance(position)

View source »

Roughly returns the distance from leaf to the given position.

Parameters

  • position Vector

Returns

  • number

GetAdjacentLeafs(range)

View source »

Returns a list of all leafs around the given leaf.

Parameters

  • range Number optional

Returns

GetArea()

View source »

Returns the leaf area.

Returns

  • number

GetBoundaryPlanes()

View source »

Returns a list of planes, pointing into the leaf.

Returns

  • Plane[]

GetCluster()

View source »

Returns the cluster-number for the leaf. Cluster numbers can be shared between multiple leafs.

Returns

  • number

GetContents()

View source »

Returns the content flag the leaf has.

Returns

  • number

GetFaces()

View source »

Returns a list of faces within this leaf. Starting at 1. Note: A face can be in multiple leafs.

Returns

  • FaceObject[]

GetIndex()

View source »

Returns the leaf index.

Returns

  • number

GetLeafWaterData()

View source »

Returns a list of LeafWaterData. Holds the data of leaf nodes that are inside water.

Returns

  • LeafWaterData[]

GetLeafs()

View source »

Returns a table of map leafs.

Returns

GetLeafsNumClusters()

View source »

Returns the number of leaf-clusters

Returns

  • number

GetNodes()

View source »

Returns a table of map nodes

Returns

GetPos()

View source »

Returns roughtly the leafs center.

Returns

  • Vector

GetWaterData()

View source »

Returns the water data, if any.

Returns

GetWaterMaxZ()

View source »

Returns the water MaxZ within the leaf.

Returns

  • number or nil

GetWaterMinZ()

View source »

Returns the water MinZ within the leaf.

Returns

  • number or nil

Has2DSkyboxInPVS()

View source »

Returns true if the leaf has the 3D sky within its PVS. Note: Seems to be deprecated. Use Leaf:HasSkyboxInPVS() and BSP:HasSkyBox() instead.

Returns

  • boolean

HasContents(CONTENTS)

View source »

Returns true if the leaf has said content

Parameters

  • CONTENTS

Returns

  • boolean

HasSkyboxInPVS()

View source »

Returns true if the leaf has the 3D sky within its PVS. Note: Seems to be broken from EP2 and up.

Returns

  • boolean

HasWater()

View source »

Returns true if the leaf has water within.

Returns

  • boolean

IsAABBOutsideMap(position, position2)

View source »

Returns true if the AABB is outside the map

Parameters

  • position Vector

  • position2 Vector

Returns

  • boolean

IsLeafAdjacent(leaf)

View source »

Returns true if the leafs are adjacent to each other.

Parameters

  • leaf

Returns

  • bool

IsOutsideMap()

View source »

Returns true if the leaf is outside the map.

Returns

  • boolean

IsPositionWithin(position)

View source »

Returns true if the position is within the given leaf.

Parameters

  • position Vector

Returns

  • boolean

IsSphereOutsideMap(position, range)

View source »

Returns true if the sphere is outside the map

Parameters

  • position Vector

  • range number

Returns

  • boolean

OBBMaxs()

View source »

Returns roughtly the leafs maximum boundary

Returns

  • Vector

OBBMins()

View source »

Returns roughtly the leafs maximum boundary

Returns

  • Vector

SphereInLeafs(iNode, origin, radius)

View source »

Returns a list of leafs within the given sphere.

Parameters

  • iNode number

  • origin Vector

  • radius number

Returns

Tables

LeafObject

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

  • mins Vector

  • maxs Vector

MapNode

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

  • children number[]