Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Attributes | List of all members
cPathCell Struct Reference

The pathfinder has 3 types of cells (cPathCell). More...

#include <Path.h>

Collaboration diagram for cPathCell:
Collaboration graph
[legend]

Public Attributes

NIBBLETYPE m_BlockMeta
 
BLOCKTYPE m_BlockType
 
int m_F
 
int m_G
 
int m_H
 
bool m_IsSolid
 
bool m_IsSpecial
 
Vector3i m_Location
 
cPathCellm_Parent
 
eCellStatus m_Status
 

Detailed Description

The pathfinder has 3 types of cells (cPathCell).

1 - empty. m_IsSolid is false, m_IsSpecial is false. Air cells are always traversable by A*. 2 - occupied / solid. m_IsSolid is true, m_IsSpecial is false. Air cells are never traversable by A*. 3 - Special. m_IsSolid is true, m_IsSpecial is true. These cells are special: They may either behave as empty or as occupied / solid, depending on the mob's direction of movement. For instance, an airblock above a fence is a special cell, because when mobs attempt to travel to it by jumping, it acts as a solid. But when mobs fall and land on top of a fence, it acts as air. Special cells include: Doors, ladders, trapdoors, water, gates.

The main function which handles special blocks is SpecialIsSolidFromThisDirection. This function receives a BlockType, a meta, and a direction of travel, then it uses those 3 parameters to decide whether the special block should behave as a solid or as air in this particular direction of travel.

Currently, only fences and water are handled properly. The function always returns "true" (meaning: treat as occuiped/solid) for the rest of the blocks. This will be fixed once the physics engine issues are fixed.

Definition at line 43 of file Path.h.

Member Data Documentation

◆ m_BlockMeta

NIBBLETYPE cPathCell::m_BlockMeta

Definition at line 52 of file Path.h.

◆ m_BlockType

BLOCKTYPE cPathCell::m_BlockType

Definition at line 51 of file Path.h.

◆ m_F

int cPathCell::m_F

Definition at line 46 of file Path.h.

◆ m_G

int cPathCell::m_G

Definition at line 46 of file Path.h.

◆ m_H

int cPathCell::m_H

Definition at line 46 of file Path.h.

◆ m_IsSolid

bool cPathCell::m_IsSolid

Definition at line 49 of file Path.h.

◆ m_IsSpecial

bool cPathCell::m_IsSpecial

Definition at line 50 of file Path.h.

◆ m_Location

Vector3i cPathCell::m_Location

Definition at line 45 of file Path.h.

◆ m_Parent

cPathCell* cPathCell::m_Parent

Definition at line 48 of file Path.h.

◆ m_Status

eCellStatus cPathCell::m_Status

Definition at line 47 of file Path.h.


The documentation for this struct was generated from the following file: