C# Class Axiom.Core.BillboardSet

A collection of billboards (faces which are always facing the camera) with the same (default) dimensions, material and which are fairly close proximity to each other.
Billboards are rectangles made up of 2 tris which are always facing the camera. They are typically used for special effects like particles. This class collects together a set of billboards with the same (default) dimensions, material and relative locality in order to process them more efficiently. The entire set of billboards will be culled as a whole (by default, although this can be changed if you want a large set of billboards which are spread out and you want them culled individually), individual Billboards have locations which are relative to the set (which itself derives it's position from the SceneNode it is attached to since it is a SceneObject), they will be rendered as a single rendering operation, and some calculations will be sped up by the fact that they use the same dimensions so some workings can be reused.

A BillboardSet can be created using the SceneManager.CreateBillboardSet method. They can also be used internally by other classes to create effects.

Inheritance: Axiom.Core.MovableObject, IRenderable
ファイルを表示 Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Property Type Description
aab Axiom.Math.AxisAlignedBox
accurateFacing bool
activeBillboards List
allDefaultRotation bool
allDefaultSize bool
autoExtendPool bool
billboardPool List
billboardType BillboardType
boundingRadius float
camPos Vector3
camQ Axiom.Math.Quaternion
camX Vector3
colorIndex int
commonDirection Vector3
commonUpVector Vector3
cullIndividual bool
currentCamera Camera
customParams List
defaultParticleHeight float
defaultParticleWidth float
fixedTextureCoords bool
freeBillboards List
indexData Axiom.Graphics.IndexData
leftOff float
lockPtr System.IntPtr
mainBuffer Axiom.Graphics.HardwareVertexBuffer
material Axiom.Graphics.Material
materialName string
numVisibleBillboards int
originType BillboardOrigin
pointRendering bool
posIndex int
ptrOffset int
rotationType BillboardRotationType
sphere Axiom.Math.Sphere
texIndex int
vOffset Vector3[]
vertexData Axiom.Graphics.VertexData
world Axiom.Math.Matrix4[]
worldSpace bool

Public Methods

Method Description
Clear ( ) : void

Empties all of the active billboards from this set.

CreateBillboard ( Vector3 position ) : Billboard

Overloaded method.

CreateBillboard ( Vector3 position, ColorEx color ) : Billboard

Creates a new billboard and adds it to this set.

UpdateBounds ( ) : void

Update the bounds of the BillboardSet.

Protected Methods

Method Description
GenerateBillboardAxes ( Vector3 &x, Vector3 &y ) : void

Overloaded method.

GenerateBillboardAxes ( Vector3 &x, Vector3 &y, Billboard bb ) : void

Generates billboard corners.

Billboard param only required for type OrientedSelf

GenerateVertexOffsets ( float left, float right, float top, float bottom, float width, float height, Vector3 &x, Vector3 &y, Vector3 destVec ) : void

Generates vertex offsets.

Takes in parametric offsets as generated from GetParametericOffsets, width and height values and billboard x and y axes as generated from GenerateBillboardAxes. Fills output array of 4 vectors with vector offsets from origin for left-top, right-top, left-bottom, right-bottom corners.

GenerateVertices ( Vector3 offsets, Billboard bb ) : void
GetBillboard ( int index ) : Billboard
GetParametricOffsets ( float &left, float &right, float &top, float &bottom ) : void

Generate parametric offsets based on the origin.

IncreasePool ( int size ) : void

Internal method for increasing pool size.

IsBillboardVisible ( Camera camera, Billboard billboard ) : bool

Determines whether the supplied billboard is visible in the camera or not.

NotifyBillboardResized ( ) : void

Callback used by Billboards to notify their parent that they have been resized.

NotifyBillboardRotated ( ) : void

Callback used by Billboards to notify their parent that they have been resized.

NotifyBillboardTextureCoordsModified ( ) : void

Notifies the billboardset that texture coordinates will be modified for this set.

RemoveBillboard ( Billboard bill ) : void
RemoveBillboard ( int index ) : void
SetBounds ( AxisAlignedBox box, float radius ) : void
SetTextureStacksAndSlices ( int stacks, int slices ) : void
dispose ( bool disposeManagedResources ) : void

Private Methods

Method Description
BeginBillboards ( ) : void

Generate the vertices for all the billboards relative to the camera Also take the opportunity to update the vertex colours May as well do it here to save on loops elsewhere

BillboardSet ( string name, int poolSize ) : System

Public constructor. Should not be created manually, must be created using a SceneManager.

BillboardSet ( string name, int poolSize, bool externalData ) : System

Public constructor. Should not be created manually, must be created using a SceneManager.

CreateBuffers ( ) : void

Allocate / reallocate vertex data Note that we allocate enough space for ALL the billboards in the pool, but only issue rendering operations for the sections relating to the active billboards

DestroyBuffers ( ) : void
EndBillboards ( ) : void
IndexData ( ) : System
InjectBillboard ( Billboard bb ) : void
VertexData ( ) : System

Method Details

Clear() public method

Empties all of the active billboards from this set.
public Clear ( ) : void
return void

CreateBillboard() public method

Overloaded method.
public CreateBillboard ( Vector3 position ) : Billboard
position Vector3
return Billboard

CreateBillboard() public method

Creates a new billboard and adds it to this set.
public CreateBillboard ( Vector3 position, ColorEx color ) : Billboard
position Vector3
color ColorEx
return Billboard

GenerateBillboardAxes() protected method

Overloaded method.
protected GenerateBillboardAxes ( Vector3 &x, Vector3 &y ) : void
x Vector3
y Vector3
return void

GenerateBillboardAxes() protected method

Generates billboard corners.
Billboard param only required for type OrientedSelf
protected GenerateBillboardAxes ( Vector3 &x, Vector3 &y, Billboard bb ) : void
x Vector3
y Vector3
bb Billboard
return void

GenerateVertexOffsets() protected method

Generates vertex offsets.
Takes in parametric offsets as generated from GetParametericOffsets, width and height values and billboard x and y axes as generated from GenerateBillboardAxes. Fills output array of 4 vectors with vector offsets from origin for left-top, right-top, left-bottom, right-bottom corners.
protected GenerateVertexOffsets ( float left, float right, float top, float bottom, float width, float height, Vector3 &x, Vector3 &y, Vector3 destVec ) : void
left float
right float
top float
bottom float
width float
height float
x Vector3
y Vector3
destVec Vector3
return void

GenerateVertices() protected method

protected GenerateVertices ( Vector3 offsets, Billboard bb ) : void
offsets Vector3
bb Billboard
return void

GetBillboard() protected method

protected GetBillboard ( int index ) : Billboard
index int
return Billboard

GetParametricOffsets() protected method

Generate parametric offsets based on the origin.
protected GetParametricOffsets ( float &left, float &right, float &top, float &bottom ) : void
left float
right float
top float
bottom float
return void

IncreasePool() protected method

Internal method for increasing pool size.
protected IncreasePool ( int size ) : void
size int
return void

IsBillboardVisible() protected method

Determines whether the supplied billboard is visible in the camera or not.
protected IsBillboardVisible ( Camera camera, Billboard billboard ) : bool
camera Camera
billboard Billboard
return bool

NotifyBillboardResized() protected method

Callback used by Billboards to notify their parent that they have been resized.
protected NotifyBillboardResized ( ) : void
return void

NotifyBillboardRotated() protected method

Callback used by Billboards to notify their parent that they have been resized.
protected NotifyBillboardRotated ( ) : void
return void

NotifyBillboardTextureCoordsModified() protected method

Notifies the billboardset that texture coordinates will be modified for this set.
protected NotifyBillboardTextureCoordsModified ( ) : void
return void

RemoveBillboard() protected method

protected RemoveBillboard ( Billboard bill ) : void
bill Billboard
return void

RemoveBillboard() protected method

protected RemoveBillboard ( int index ) : void
index int
return void

SetBounds() protected method

protected SetBounds ( AxisAlignedBox box, float radius ) : void
box Axiom.Math.AxisAlignedBox
radius float
return void

SetTextureStacksAndSlices() protected method

protected SetTextureStacksAndSlices ( int stacks, int slices ) : void
stacks int
slices int
return void

UpdateBounds() public method

Update the bounds of the BillboardSet.
public UpdateBounds ( ) : void
return void

dispose() protected method

protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
return void

Property Details

aab protected_oe property

Bounds of all billboards in this set
protected AxisAlignedBox,Axiom.Math aab
return Axiom.Math.AxisAlignedBox

accurateFacing protected_oe property

protected bool accurateFacing
return bool

activeBillboards protected_oe property

protected List activeBillboards
return List

allDefaultRotation protected_oe property

protected bool allDefaultRotation
return bool

allDefaultSize protected_oe property

protected bool allDefaultSize
return bool

autoExtendPool protected_oe property

protected bool autoExtendPool
return bool

billboardPool protected_oe property

protected List billboardPool
return List

billboardType protected_oe property

Type of billboard to render.
protected BillboardType billboardType
return BillboardType

boundingRadius protected_oe property

The local bounding radius of this object.
protected float boundingRadius
return float

camPos protected_oe property

protected Vector3 camPos
return Vector3

camQ protected_oe property

protected Quaternion,Axiom.Math camQ
return Axiom.Math.Quaternion

camX protected_oe property

protected Vector3 camX
return Vector3

colorIndex protected_oe property

protected int colorIndex
return int

commonDirection protected_oe property

Common direction for billboard oriented with type Common.
protected Vector3 commonDirection
return Vector3

commonUpVector protected_oe property

Common up vector for billboard oriented with type Perpendicular.
protected Vector3 commonUpVector
return Vector3

cullIndividual protected_oe property

Indicates whether or not each billboard should be culled individually.
protected bool cullIndividual
return bool

currentCamera protected_oe property

protected Camera,Axiom.Core currentCamera
return Camera

customParams protected_oe property

protected List customParams
return List

defaultParticleHeight protected_oe property

protected float defaultParticleHeight
return float

defaultParticleWidth protected_oe property

Default width/height of each billboard.
protected float defaultParticleWidth
return float

fixedTextureCoords protected_oe property

Are tex coords fixed? If not they have been modified.
protected bool fixedTextureCoords
return bool

freeBillboards protected_oe property

protected List freeBillboards
return List

indexData protected_oe property

protected IndexData,Axiom.Graphics indexData
return Axiom.Graphics.IndexData

leftOff protected_oe property

protected float leftOff
return float

lockPtr protected_oe property

protected IntPtr,System lockPtr
return System.IntPtr

mainBuffer protected_oe property

protected HardwareVertexBuffer,Axiom.Graphics mainBuffer
return Axiom.Graphics.HardwareVertexBuffer

material protected_oe property

Reference to the material to use
protected Material,Axiom.Graphics material
return Axiom.Graphics.Material

materialName protected_oe property

Name of the material to use
protected string materialName
return string

numVisibleBillboards protected_oe property

protected int numVisibleBillboards
return int

originType protected_oe property

Origin of each billboard
protected BillboardOrigin originType
return BillboardOrigin

pointRendering protected_oe property

protected bool pointRendering
return bool

posIndex protected_oe property

protected int posIndex
return int

ptrOffset protected_oe property

protected int ptrOffset
return int

rotationType protected_oe property

protected BillboardRotationType rotationType
return BillboardRotationType

sphere protected_oe property

protected Sphere,Axiom.Math sphere
return Axiom.Math.Sphere

texIndex protected_oe property

protected int texIndex
return int

vOffset protected_oe property

protected Vector3[] vOffset
return Vector3[]

vertexData protected_oe property

protected VertexData,Axiom.Graphics vertexData
return Axiom.Graphics.VertexData

world protected_oe property

protected Matrix4[],Axiom.Math world
return Axiom.Math.Matrix4[]

worldSpace protected_oe property

True if particles follow the object the ParticleSystem is attached to.
protected bool worldSpace
return bool