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
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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