C# Класс Axiom.SceneManagers.Bsp.BspSceneManager

Specialisation of the SceneManager class to deal with indoor scenes based on a BSP tree.
This class refines the behaviour of the default SceneManager to manage a scene whose bulk of geometry is made up of an indoor environment which is organised by a Binary Space Partition (BSP) tree.

A BSP tree progressively subdivides the space using planes which are the nodes of the tree. At some point we stop subdividing and everything in the remaining space is part of a 'leaf' which contains a number of polygons. Typically we traverse the tree to locate the leaf in which a point in space is (say the camera origin) and work from there. A second structure, the Potentially Visible Set, tells us which other leaves can been seen from this leaf, and we test their bounding boxes against the camera frustum to see which we need to draw. Leaves are also a good place to start for collision detection since they divide the level into discrete areas for testing.

This BSP and PVS technique has been made famous by engines such as Quake and Unreal. Ogre provides support for loading Quake3 level files to populate your world through this class, by calling the BspSceneManager.LoadWorldGeometry. Note that this interface is made available at the top level of the SceneManager class so you don't have to write your code specifically for this class - just call Root::getSceneManager passing a SceneType of ST_INDOOR and in the current implementation you will get a BspSceneManager silently disguised as a standard SceneManager.

Наследование: Axiom.Core.SceneManager
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
aaBGeometry Axiom.Graphics.RenderOperation
bspGeometry BspGeometry
faceGroupChecked bool>.Dictionary
level BspLevel
lightAddedToFrustum bool[]
matFaceGroupMap BspStaticFaceGroup>.Collections.MultiMap
objectsForRendering Axiom.Collections.MovableObjectCollection
renderOp Axiom.Graphics.RenderOperation
showNodeAABs bool
spotlightFrustum SpotlightFrustum
textureLightMaterial Axiom.Graphics.Material
textureLightPass Axiom.Graphics.Pass

Открытые методы

Метод Описание
BspSceneManager ( string name ) : System
CreateIntersectionQuery ( uint mask ) : IntersectionSceneQuery

Creates an IntersectionSceneQuery for this scene manager.

This method creates a new instance of a query object for locating intersecting objects. See SceneQuery and IntersectionSceneQuery for full details.

CreateRayQuery ( Ray ray, uint mask ) : RaySceneQuery

Creates a RaySceneQuery for this scene manager.

This method creates a new instance of a query object for this scene manager, looking for objects which fall along a ray. See SceneQuery and RaySceneQuery for full details.

CreateSceneNode ( ) : SceneNode

Creates a specialized Plugin_BSPSceneManager.BspSceneNode.

CreateSceneNode ( string name ) : SceneNode

Creates a specialized Plugin_BSPSceneManager.BspSceneNode.

CreateSphereRegionQuery ( Sphere sphere, uint mask ) : SphereRegionSceneQuery

Creates a SphereSceneQuery for this scene manager.

This method creates a new instance of a query object for this scene manager, for a spherical region. See SceneQuery and SphereSceneQuery for full details.

EstimateWorldGeometry ( Stream stream, string typeName ) : int
EstimateWorldGeometry ( string filename ) : int
FindVisibleObjects ( Camera camera, bool onlyShadowCasters ) : void

Overriden from SceneManager.

GetSuggestedViewpoint ( bool random ) : ViewPoint

Specialised to suggest viewpoints.

LoadWorldGeometry ( ) : void
LoadWorldGeometry ( string filename ) : void

Specialized from SceneManager to support Quake3 bsp files.

SetWorldGeometry ( Stream stream, string typeName ) : void
SetWorldGeometry ( string filename ) : void

Защищенные методы

Метод Описание
AddBoundingBox ( AxisAlignedBox aab, bool visible ) : void

Adds a bounding box to draw if turned on.

CacheGeometry ( IntPtr indexes, BspStaticFaceGroup faceGroup ) : int

Caches a face group for imminent rendering.

CacheLightGeometry ( TextureLight light, uint pIndexes, TextureLightMap pTexLightMaps, BspVertex pVertices, BspStaticFaceGroup faceGroup ) : int

Caches a face group and calculates texture lighting coordinates.

FindShadowCastersForLight ( Light light, Camera camera ) : IList
InitTextureLighting ( ) : void
OnRenderQueueEnded ( RenderQueueGroupID group, string invocation ) : bool
ProcessVisibleLeaf ( Axiom.SceneManagers.Bsp.BspNode leaf, Camera camera, bool onlyShadowCasters ) : void

Tags geometry in the leaf specified for later rendering.

RenderSingleObject ( IRenderable renderable, Pass pass, bool doLightIteration, LightList manualLightList ) : void

Overriden from SceneManager.

RenderStaticGeometry ( ) : void

Renders the static level geometry tagged in Plugin_BSPSceneManager.BspSceneManager.WalkTree.

RenderTextureLighting ( Light light ) : void

Renders the texture lighting tagged in the specified light

RenderTextureShadowOnGeometry ( ) : void

Renders texture shadow on tagged in level geometry.

WalkTree ( Camera camera, bool onlyShadowCasters ) : Axiom.SceneManagers.Bsp.BspNode

Walks the BSP tree looking for the node which the camera is in, and tags any geometry which is in a visible leaf for later processing.

Приватные методы

Метод Описание
NotifyObjectDetached ( Axiom.Core.MovableObject obj ) : void

Internal method for notifying the level that an object has been detached from a node.

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

Internal method for tagging Plugin_BSPSceneManager.BspNode's with objects which intersect them.

Описание методов

AddBoundingBox() защищенный метод

Adds a bounding box to draw if turned on.
protected AddBoundingBox ( AxisAlignedBox aab, bool visible ) : void
aab Axiom.Math.AxisAlignedBox
visible bool
Результат void

BspSceneManager() публичный метод

public BspSceneManager ( string name ) : System
name string
Результат System

CacheGeometry() защищенный метод

Caches a face group for imminent rendering.
protected CacheGeometry ( IntPtr indexes, BspStaticFaceGroup faceGroup ) : int
indexes System.IntPtr
faceGroup BspStaticFaceGroup
Результат int

CacheLightGeometry() защищенный метод

Caches a face group and calculates texture lighting coordinates.
protected CacheLightGeometry ( TextureLight light, uint pIndexes, TextureLightMap pTexLightMaps, BspVertex pVertices, BspStaticFaceGroup faceGroup ) : int
light TextureLight
pIndexes uint
pTexLightMaps TextureLightMap
pVertices BspVertex
faceGroup BspStaticFaceGroup
Результат int

CreateIntersectionQuery() публичный метод

Creates an IntersectionSceneQuery for this scene manager.
This method creates a new instance of a query object for locating intersecting objects. See SceneQuery and IntersectionSceneQuery for full details.
public CreateIntersectionQuery ( uint mask ) : IntersectionSceneQuery
mask uint The query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.
Результат Axiom.Core.IntersectionSceneQuery

CreateRayQuery() публичный метод

Creates a RaySceneQuery for this scene manager.
This method creates a new instance of a query object for this scene manager, looking for objects which fall along a ray. See SceneQuery and RaySceneQuery for full details.
public CreateRayQuery ( Ray ray, uint mask ) : RaySceneQuery
ray Axiom.Math.Ray Details of the ray which describes the region for this query.
mask uint The query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.
Результат Axiom.Core.RaySceneQuery

CreateSceneNode() публичный метод

Creates a specialized Plugin_BSPSceneManager.BspSceneNode.
public CreateSceneNode ( ) : SceneNode
Результат Axiom.Core.SceneNode

CreateSceneNode() публичный метод

Creates a specialized Plugin_BSPSceneManager.BspSceneNode.
public CreateSceneNode ( string name ) : SceneNode
name string
Результат Axiom.Core.SceneNode

CreateSphereRegionQuery() публичный метод

Creates a SphereSceneQuery for this scene manager.
This method creates a new instance of a query object for this scene manager, for a spherical region. See SceneQuery and SphereSceneQuery for full details.
public CreateSphereRegionQuery ( Sphere sphere, uint mask ) : SphereRegionSceneQuery
sphere Axiom.Math.Sphere Details of the sphere which describes the region for this query.
mask uint The query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.
Результат Axiom.Core.SphereRegionSceneQuery

EstimateWorldGeometry() публичный метод

public EstimateWorldGeometry ( Stream stream, string typeName ) : int
stream Stream
typeName string
Результат int

EstimateWorldGeometry() публичный метод

public EstimateWorldGeometry ( string filename ) : int
filename string
Результат int

FindShadowCastersForLight() защищенный метод

protected FindShadowCastersForLight ( Light light, Camera camera ) : IList
light Axiom.Core.Light
camera Axiom.Core.Camera
Результат IList

FindVisibleObjects() публичный метод

Overriden from SceneManager.
public FindVisibleObjects ( Camera camera, bool onlyShadowCasters ) : void
camera Axiom.Core.Camera
onlyShadowCasters bool
Результат void

GetSuggestedViewpoint() публичный метод

Specialised to suggest viewpoints.
public GetSuggestedViewpoint ( bool random ) : ViewPoint
random bool
Результат Axiom.Core.ViewPoint

InitTextureLighting() защищенный метод

protected InitTextureLighting ( ) : void
Результат void

LoadWorldGeometry() публичный метод

public LoadWorldGeometry ( ) : void
Результат void

LoadWorldGeometry() публичный метод

Specialized from SceneManager to support Quake3 bsp files.
public LoadWorldGeometry ( string filename ) : void
filename string
Результат void

OnRenderQueueEnded() защищенный метод

protected OnRenderQueueEnded ( RenderQueueGroupID group, string invocation ) : bool
group RenderQueueGroupID
invocation string
Результат bool

ProcessVisibleLeaf() защищенный метод

Tags geometry in the leaf specified for later rendering.
protected ProcessVisibleLeaf ( Axiom.SceneManagers.Bsp.BspNode leaf, Camera camera, bool onlyShadowCasters ) : void
leaf Axiom.SceneManagers.Bsp.BspNode
camera Axiom.Core.Camera
onlyShadowCasters bool
Результат void

RenderSingleObject() защищенный метод

Overriden from SceneManager.
protected RenderSingleObject ( IRenderable renderable, Pass pass, bool doLightIteration, LightList manualLightList ) : void
renderable IRenderable
pass Axiom.Graphics.Pass
doLightIteration bool
manualLightList LightList
Результат void

RenderStaticGeometry() защищенный метод

Renders the static level geometry tagged in Plugin_BSPSceneManager.BspSceneManager.WalkTree.
protected RenderStaticGeometry ( ) : void
Результат void

RenderTextureLighting() защищенный метод

Renders the texture lighting tagged in the specified light
protected RenderTextureLighting ( Light light ) : void
light Axiom.Core.Light
Результат void

RenderTextureShadowOnGeometry() защищенный метод

Renders texture shadow on tagged in level geometry.
protected RenderTextureShadowOnGeometry ( ) : void
Результат void

SetWorldGeometry() публичный метод

public SetWorldGeometry ( Stream stream, string typeName ) : void
stream Stream
typeName string
Результат void

SetWorldGeometry() публичный метод

public SetWorldGeometry ( string filename ) : void
filename string
Результат void

WalkTree() защищенный метод

Walks the BSP tree looking for the node which the camera is in, and tags any geometry which is in a visible leaf for later processing.
protected WalkTree ( Camera camera, bool onlyShadowCasters ) : Axiom.SceneManagers.Bsp.BspNode
camera Axiom.Core.Camera
onlyShadowCasters bool
Результат Axiom.SceneManagers.Bsp.BspNode

Описание свойств

aaBGeometry защищенное свойство

protected RenderOperation,Axiom.Graphics aaBGeometry
Результат Axiom.Graphics.RenderOperation

bspGeometry защищенное свойство

protected BspGeometry,Axiom.SceneManagers.Bsp bspGeometry
Результат BspGeometry

faceGroupChecked защищенное свойство

protected Dictionary faceGroupChecked
Результат bool>.Dictionary

level защищенное свойство

protected BspLevel,Axiom.SceneManagers.Bsp level
Результат BspLevel

lightAddedToFrustum защищенное свойство

protected bool[] lightAddedToFrustum
Результат bool[]

matFaceGroupMap защищенное свойство

protected Collections.MultiMap matFaceGroupMap
Результат BspStaticFaceGroup>.Collections.MultiMap

objectsForRendering защищенное свойство

protected MovableObjectCollection,Axiom.Collections objectsForRendering
Результат Axiom.Collections.MovableObjectCollection

renderOp защищенное свойство

protected RenderOperation,Axiom.Graphics renderOp
Результат Axiom.Graphics.RenderOperation

showNodeAABs защищенное свойство

protected bool showNodeAABs
Результат bool

spotlightFrustum защищенное свойство

protected SpotlightFrustum,Axiom.SceneManagers.Bsp spotlightFrustum
Результат SpotlightFrustum

textureLightMaterial защищенное свойство

protected Material,Axiom.Graphics textureLightMaterial
Результат Axiom.Graphics.Material

textureLightPass защищенное свойство

protected Pass,Axiom.Graphics textureLightPass
Результат Axiom.Graphics.Pass