MCPcopy Create free account
hub / github.com/ByteArena/box2d / FreeNode

Method FreeNode

CollisionB2DynamicTree.go:254–261  ·  view source on GitHub ↗

Return a node to the pool.

(nodeId int)

Source from the content-addressed store, hash-verified

252
253// Return a node to the pool.
254func (tree *B2DynamicTree) FreeNode(nodeId int) {
255 B2Assert(0 <= nodeId && nodeId < tree.M_nodeCapacity)
256 B2Assert(0 < tree.M_nodeCount)
257 tree.M_nodes[nodeId].Next = tree.M_freeList
258 tree.M_nodes[nodeId].Height = -1
259 tree.M_freeList = nodeId
260 tree.M_nodeCount--
261}
262
263// Create a proxy in the tree as a leaf node. We return the index
264// of the node instead of a pointer so that we can grow

Callers 3

DestroyProxyMethod · 0.95
RemoveLeafMethod · 0.95
RebuildBottomUpMethod · 0.95

Calls 1

B2AssertFunction · 0.85

Tested by

no test coverage detected