C# Class Axiom.SceneManagers.Bsp.BspLevel

Holds all the data associated with a Binary Space Parition (BSP) based indoor level.
The data used here is populated by loading level files via the BspLevelManager.Load method, although application users are more likely to call SceneManager.SetWorldGeometry which will automatically arrange the loading of the level. Note that this assumes that you have asked for an indoor-specialized SceneManager (specify SceneType.Indoor when calling Engine.GetSceneManager).

We currently only support loading from Quake3 Arena level files, although any source that can be converted into this classes structure could also be used. The Quake3 level load process is in a different class called Quake3Level to keep the specifics separate.

Inheritance: Axiom.Core.Resource
显示文件 Open project: mono-soc-2011/axiom Class Usage Examples

Protected Properties

Property Type Description
brushes Axiom.SceneManagers.Bsp.BspBrush[]
bspOptions BspOptions
createParam NameValuePairList
faceGroups Axiom.SceneManagers.Bsp.BspStaticFaceGroup[]
indexes Axiom.Graphics.HardwareIndexBuffer
leafFaceGroups int[]
leafStart int
nodes Axiom.SceneManagers.Bsp.BspNode[]
numIndexes int
numLeaves int
objectToNodeMap BspNode>.MultiMap
patchIndexCount int
patchVertexCount int
patches PatchSurface>.AxiomSortedCollection
playerStarts List
vertexData Axiom.Graphics.VertexData
visData VisData

Public Methods

Method Description
BspLevel ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams ) : System

Default constructor - used by BspResourceManager (do not call directly).

BuildQuake3Patches ( int vertOffset, int indexOffset ) : void
CalculateLoadingStages ( string filename ) : int
FindLeaf ( Vector3 point ) : Axiom.SceneManagers.Bsp.BspNode

Walks the entire BSP tree and returns the leaf which contains the given point.

InitQuake3Patches ( Quake3Level q3lvl, Axiom.Graphics.VertexDeclaration decl ) : void
IsLeafVisible ( Axiom.SceneManagers.Bsp.BspNode from, Axiom.SceneManagers.Bsp.BspNode to ) : bool

Determines if one leaf node is visible from another.

Load ( Stream stream ) : void

Protected Methods

Method Description
LoadEntities ( Quake3Level q3lvl ) : void

Internal method for parsing chosen entities.

LoadQuake3Level ( Quake3Level q3lvl ) : void

/** Internal utility function for loading data from Quake3.

QuakeVertexToBspVertex ( InternalBspVertex src, BspVertex &dest, TextureLightMap &texLightMap ) : void
TagNodesWithObject ( Axiom.SceneManagers.Bsp.BspNode node, Axiom.Core.MovableObject obj, Vector3 pos ) : void
load ( ) : void

Generic load - called by Plugin_BSPSceneManager.BspResourceManager.

unload ( ) : void

Generic unload - called by BspResourceManager.

Private Methods

Method Description
NotifyObjectDetached ( Axiom.Core.MovableObject obj ) : void

Internal method, makes sure an object is removed from the leaves when detached from a node.

NotifyObjectMoved ( Axiom.Core.MovableObject obj, Vector3 pos ) : void

Ensures that the Axiom.Core.SceneObject is attached to the right leaves of the BSP tree.

calculateLoadingStages ( Stream stream ) : int

Method Details

BspLevel() public method

Default constructor - used by BspResourceManager (do not call directly).
public BspLevel ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
isManual bool
loader IManualResourceLoader
createParams NameValuePairList
return System

BuildQuake3Patches() public method

public BuildQuake3Patches ( int vertOffset, int indexOffset ) : void
vertOffset int
indexOffset int
return void

CalculateLoadingStages() public static method

public static CalculateLoadingStages ( string filename ) : int
filename string
return int

FindLeaf() public method

Walks the entire BSP tree and returns the leaf which contains the given point.
public FindLeaf ( Vector3 point ) : Axiom.SceneManagers.Bsp.BspNode
point Vector3
return Axiom.SceneManagers.Bsp.BspNode

InitQuake3Patches() public method

public InitQuake3Patches ( Quake3Level q3lvl, Axiom.Graphics.VertexDeclaration decl ) : void
q3lvl Quake3Level
decl Axiom.Graphics.VertexDeclaration
return void

IsLeafVisible() public method

Determines if one leaf node is visible from another.
public IsLeafVisible ( Axiom.SceneManagers.Bsp.BspNode from, Axiom.SceneManagers.Bsp.BspNode to ) : bool
from Axiom.SceneManagers.Bsp.BspNode
to Axiom.SceneManagers.Bsp.BspNode
return bool

Load() public method

public Load ( Stream stream ) : void
stream Stream
return void

LoadEntities() protected method

Internal method for parsing chosen entities.
protected LoadEntities ( Quake3Level q3lvl ) : void
q3lvl Quake3Level
return void

LoadQuake3Level() protected method

/** Internal utility function for loading data from Quake3.
protected LoadQuake3Level ( Quake3Level q3lvl ) : void
q3lvl Quake3Level
return void

QuakeVertexToBspVertex() protected method

protected QuakeVertexToBspVertex ( InternalBspVertex src, BspVertex &dest, TextureLightMap &texLightMap ) : void
src InternalBspVertex
dest BspVertex
texLightMap TextureLightMap
return void

TagNodesWithObject() protected method

protected TagNodesWithObject ( Axiom.SceneManagers.Bsp.BspNode node, Axiom.Core.MovableObject obj, Vector3 pos ) : void
node Axiom.SceneManagers.Bsp.BspNode
obj Axiom.Core.MovableObject
pos Vector3
return void

load() protected method

Generic load - called by Plugin_BSPSceneManager.BspResourceManager.
protected load ( ) : void
return void

unload() protected method

Generic unload - called by BspResourceManager.
protected unload ( ) : void
return void

Property Details

brushes protected_oe property

protected BspBrush[],Axiom.SceneManagers.Bsp brushes
return Axiom.SceneManagers.Bsp.BspBrush[]

bspOptions protected_oe property

protected BspOptions,Axiom.SceneManagers.Bsp bspOptions
return BspOptions

createParam protected_oe property

protected NameValuePairList createParam
return NameValuePairList

faceGroups protected_oe property

Array of face groups, indexed into by contents of mLeafFaceGroups.
protected BspStaticFaceGroup[],Axiom.SceneManagers.Bsp faceGroups
return Axiom.SceneManagers.Bsp.BspStaticFaceGroup[]

indexes protected_oe property

protected HardwareIndexBuffer,Axiom.Graphics indexes
return Axiom.Graphics.HardwareIndexBuffer

leafFaceGroups protected_oe property

Array of indexes into the faceGroups array. This buffer is organised by leaf node so leaves can just use contiguous chunks of it and get repointed to the actual entries in faceGroups.
protected int[] leafFaceGroups
return int[]

leafStart protected_oe property

protected int leafStart
return int

nodes protected_oe property

protected BspNode[],Axiom.SceneManagers.Bsp nodes
return Axiom.SceneManagers.Bsp.BspNode[]

numIndexes protected_oe property

Indexes for the whole level, will be copied to the real indexdata per frame.
protected int numIndexes
return int

numLeaves protected_oe property

protected int numLeaves
return int

objectToNodeMap protected_oe property

protected MultiMap objectToNodeMap
return BspNode>.MultiMap

patchIndexCount protected_oe property

Total number of indexes required for all patches.
protected int patchIndexCount
return int

patchVertexCount protected_oe property

Total number of vertices required for all patches.
protected int patchVertexCount
return int

patches protected_oe property

Storage of patches
protected AxiomSortedCollection patches
return PatchSurface>.AxiomSortedCollection

playerStarts protected_oe property

protected List playerStarts
return List

vertexData protected_oe property

Vertex data holding all the data for the level, but able to render parts of it/
protected VertexData,Axiom.Graphics vertexData
return Axiom.Graphics.VertexData

visData protected_oe property

protected VisData visData
return VisData