HGamer3D-Ogre-Binding-0.1.8: Library to enable 3D game development for Haskell - Ogre Bindings

Safe HaskellSafe-Infered

HGamer3D.Bindings.Ogre.ClassBillboardSet

Synopsis

Documentation

newSource

Arguments

:: String

name - The name to give the billboard set (must be unique)

-> Int

poolSize - The initial size of the billboard pool. Estimate of the number of billboards which will be required, and pass it using this parameter. The set will preallocate this number to avoid memory fragmentation. The default behaviour once this pool has run out is to double it.

-> Bool

externalDataSource - If true, the source of data for drawing the billboards will not be the internal billboard list, but external data. When driving the billboard from external data, you must call _notifyCurrentCamera to reorient the billboards, setPoolSize to set the maximum billboards you want to use, beginBillboards to start the update, and injectBillboard per billboard, followed by endBillboards.

-> IO HG3DClass 

Usual constructor - this is called by the SceneManagerBillboardSet::setAutoextend

deleteSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance which is going to be deleted.

-> IO () 

Creates a new billboard and adds it to this set. Behaviour once the billboard pool has been exhausted depends on the BillboardSet::setAutoextendPool option. On failiure (i.e. no more space and can't autoextend), NULLBillboardSet::setAutoextend

createBillboardSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Vec3

position - The position of the new billboard realtive to the certer of the set

-> Colour

colour - Optional base colour of the billboard.

-> IO HG3DClass

return value - On success, a pointer to a newly created

createBillboard2Source

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Float

x

-> Float

y

-> Float

z - The position of the new billboard relative to the center of the set

-> Colour

colour - Optional base colour of the billboard.

-> IO HG3DClass

return value - On success, a pointer to a newly created

Creates a new billboard and adds it to this set. Behaviour once the billboard pool has been exhausted depends on the BillboardSet::setAutoextendPool option. On failure (i.e. no more space and can't autoextend), NULLBillboardSet::setAutoextend

getNumBillboardsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Int 

Returns the number of active billboards which currently make up this set.

setAutoextendSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

autoextend - true to double the pool every time it runs out, false to fail silently.

-> IO () 

Returns true if the billboard pool automatically extends. BillboardSet::setAutoextend

Tells the set whether to allow automatic extension of the pool of billboards. A BillboardSetThe default behaviour is to allow the pool to extend (typically this allocates double the current pool of billboards when the pool is expended), equivalent to calling this method with autoExtend = true. If you set the parameter to false however, any attempt to create a new billboard when the pool has expired will simply fail silently, returning a null pointer.

getAutoextendSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Bool 

setSortingEnabledSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

sortenable - true to sort the billboards according to their distance to the camera

-> IO () 

Returns true if sorting of billboards is enabled based on their distance from the camera BillboardSet::setSortingEnabled

Enables sorting for this BillboardSet

getSortingEnabledSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Bool 

setPoolSizeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Int

size - The new size for the pool.

-> IO () 

Returns the current size of the billboard pool. BillboardSet::setAutoextend

Adjusts the size of the pool of billboards available in this set. See the BillboardSet::setAutoextend

getPoolSizeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Int

return value - The current size of the billboard pool.

clearSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO () 

Returns a pointer to the billboard at the supplied index. This method requires linear time since the billboard list is a linked list. On failure, NULL

Empties this set of all billboards.

getBillboardSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Int

index - The index of the billboard that is requested.

-> IO HG3DClass

return value - On success, a valid pointer to the requested billboard is returned.

removeBillboardSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Int

index

-> IO () 

Removes a billboard from the set. This version is more efficient than removing by index.

Removes the billboard at the supplied index. This method requires linear time since the billboard list is a linked list.

removeBillboard2Source

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> HG3DClass

pBill

-> IO () 

Sets the point which acts as the origin point for all billboards in this set. This setting controls the fine tuning of where a billboard appears in relation to it's position. It could be that a billboard's position represents it's center (e.g. for fireballs), it could mean the center of the bottom edge (e.g. a tree which is positioned on the ground), the top-left corner (e.g. a cursor). The default setting is BBO_CENTER.

setBillboardOriginSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> EnumBillboardOrigin

origin - A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.

-> IO () 

Gets the point which acts as the origin point for all billboards in this set.

getBillboardOriginSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO EnumBillboardOrigin

return value - A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.

setBillboardRotationTypeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> EnumBillboardRotationType

rotationType - A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.

-> IO () 

Sets billboard rotation type.

Sets billboard rotation type. This setting controls the billboard rotation type, you can deciding rotate the billboard's vertices around their facing direction or rotate the billboard's texture coordinates. The default settings is BBR_TEXCOORD.

getBillboardRotationTypeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO EnumBillboardRotationType

return value - A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.

setDefaultDimensionsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Float

width - The new default width for the billboards in this set.

-> Float

height - The new default height for the billboards in this set.

-> IO () 

See setDefaultDimensions - this sets 1 component individually.

Sets the default dimensions of the billboards in this set. All billboards in a set are created with these default dimensions. The set will render most efficiently if all the billboards in the set are the default size. It is possible to alter the size of individual billboards at the expense of extra calculation. See the Billboard

setDefaultWidthSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Float

width

-> IO () 

See setDefaultDimensions - this gets 1 component individually.

getDefaultWidthSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Float 

setDefaultHeightSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Float

height

-> IO () 

See setDefaultDimensions - this gets 1 component individually.

See setDefaultDimensions - this sets 1 component individually.

getDefaultHeightSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Float 

setMaterialNameSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> String

name - The new name of the material to use for this set.

-> String

groupName

-> IO () 

Sets the name of the material to be used for this billboard set.

Sets the name of the material to be used for this billboard set.

getMaterialNameSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO String

return value - The name of the material that is used for this set.

beginBillboardsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Int

numBillboards - If you know the number of billboards you will be issuing, state it here to make the update more efficient.

-> IO () 

Define a billboard.

Begin injection of billboard data; applicable when constructing the BillboardSet

injectBillboardSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> HG3DClass

bb

-> IO () 

Finish defining billboards.

endBillboardsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO () 

Overridden from MovableObjectMovableObject

getBoundingRadiusSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Float 

getMaterialSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO SharedPtr 

Overridden from MovableObjectMovableObject

setMaterialSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> SharedPtr

material - The new material to use for this set.

-> IO () 

Returns whether or not billboards in this are tested individually for culling.

Sets the name of the material to be used for this billboard set.

getCullIndividuallySource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Bool 

setCullIndividuallySource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

cullIndividual - If true, each billboard is tested before being sent to the pipeline as well as the whole set having to pass the coarse group bounding test.

-> IO () 

Sets the type of billboard to render. The default sort of billboard (BBT_POINT), always has both x and y axes parallel to the camera's local axes. This is fine for point style billboards (e.g. flares, smoke, anything which is symmetrical about a central point) but does not look good for billboards which have an orientation (e.g. an elongated raindrop). In this case, the oriented billboards are more suitable (BBT_ORIENTED_COMMON or BBT_ORIENTED_SELF) since they retain an independant Y axis and only the X axis is generated, perpendicular to both the local Y and the camera Z. In some case you might want the billboard has fixed Z axis and doesn't need to face to camera (e.g. an aureola around the player and parallel to the ground). You can use BBT_PERPENDICULAR_SELF which the billboard plane perpendicular to the billboard own direction. Or BBT_PERPENDICULAR_COMMON which the billboard plane perpendicular to the common direction. BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON can't guarantee counterclockwise, you might use double-side material (cull_hardware node

Sets whether culling tests billboards in this individually as well as in a group. BillboardThis is useful when you have a large, fairly distributed set of billboards, like maybe trees on a landscape. You probably still want to group them into more than one set (maybe one set per section of landscape), which will be culled coarsely, but you also want to cull the billboards individually because they are spread out. Whilst you could have lots of single-tree sets which are culled separately, this would be inefficient to render because each tree would be issued as it's own rendering operation. By calling this method with a parameter of true, you can have large billboard sets which are spaced out and so get the benefit of batch rendering and coarse culling, but also have fine-grained culling so unnecessary rendering is avoided.

setBillboardTypeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> EnumBillboardType

bbt - The type of billboard to render

-> IO () 

Returns the billboard type in use.

getBillboardTypeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO EnumBillboardType 

setCommonDirectionSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Vec3

vec - The direction for all billboards.

-> IO () 

Gets the common direction for all billboards (BBT_ORIENTED_COMMON)

Use this to specify the common direction given to billboards of type BBT_ORIENTED_COMMON or BBT_PERPENDICULAR_COMMON. Use BBT_ORIENTED_COMMON when you want oriented billboards but you know they are always going to be oriented the same way (e.g. rain in calm weather). It is faster for the system to calculate the billboard vertices if they have a common direction. The common direction also use in BBT_PERPENDICULAR_COMMON, in this case the common direction treat as Z axis, and an additional common up-vector was use to determine billboard X and Y axis. setCommonUpVectorThe direction are use as is, never normalised in internal, user are supposed to normalise it himself.

getCommonDirectionSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Vec3 

setCommonUpVectorSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Vec3

vec - The up-vector for all billboards.

-> IO () 

Gets the common up-vector for all billboards (BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON)

Use this to specify the common up-vector given to billboards of type BBT_PERPENDICULAR_SELF or BBT_PERPENDICULAR_COMMON. Use BBT_PERPENDICULAR_SELF or BBT_PERPENDICULAR_COMMON when you want oriented billboards perpendicular to specify direction vector (or, Z axis), and doesn't face to camera. In this case, we need an additional up-vector to determine the billboard X and Y axis. The generated billboard plane and X-axis guarantee perpendicular to specify direction. setCommonDirectionThe specify direction is billboard own direction when billboard type is BBT_PERPENDICULAR_SELF, and it's shared common direction when billboard type is BBT_PERPENDICULAR_COMMON. The up-vector are use as is, never normalised in internal, user are supposed to normalise it himself.

getCommonUpVectorSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Vec3 

setUseAccurateFacingSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

acc - True to use the slower but more accurate model. Default is false.

-> IO () 

Gets whether or not billboards use an accurate facing model based on the vector from each billboard to the camera, rather than an optimised version using just the camera direction.

Sets whether or not billboards should use an accurate facing model based on the vector from each billboard to the camera, rather than an optimised version using just the camera direction. By default, the axes for all billboards are calculated using the camera's view direction, not the vector from the camera position to the billboard. The former is faster, and most of the time the difference is not noticeable. However for some purposes (e.g. very large, static billboards) the changing billboard orientation when rotating the camera can be off putting, therefore you can enable this option to use a more expensive, but more accurate version.

getUseAccurateFacingSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Bool 

getMovableTypeSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO String 

Overridden from MovableObject

getSquaredViewDepthSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> HG3DClass

cam

-> IO Float 

Overridden, see Renderable

setBillboardsInWorldSpaceSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

ws

-> IO () 

Set whether or not the BillboardSetBy default a billboardset is rendered by generating geometry for a textured quad in memory, taking into account the size and orientation settings, and uploading it to the video card. The alternative is to use hardware point rendering, which means that only one position needs to be sent per billboard rather than 4 and the hardware sorts out how this is rendered based on the render state. Using point rendering is faster than generating quads manually, but is more restrictive. The following restrictions apply:

You will almost certainly want to enable in your material pass both point attenuation and point sprites if you use this option.

Sets whether billboards should be treated as being in world space. This is most useful when you are driving the billboard set from an external data source.

isPointRenderingEnabledSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Bool 

setPointRenderingEnabledSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

enabled - True to enable point rendering, false otherwise

-> IO () 

Returns whether point rendering is enabled.

getTypeFlagsSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Int 

Override to return specific type flag.

setAutoUpdateSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> Bool

autoUpdate

-> IO () 

Return the auto update state of this billboard set.

Set the auto update state of this billboard set. This methods controls the updating policy of the vertex buffer. By default auto update is true so the vertex buffer is being update every time this billboard set is about to be rendered. This behavior best fit when the billboards of this set changes frequently. When using static or semi-static billboards, it is recommended to set auto update to false. In that case one should call notifyBillboardDataChanged method to reflect changes made to the billboards data.

getAutoUpdateSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO Bool 

notifyBillboardDataChangedSource

Arguments

:: HG3DClass

classpointer - pointer of Class instance from which this methods is called.

-> IO () 

When billboard set is not auto updating its GPU buffer, the user is responsible to inform it about any billboard changes in order to reflect them at the rendering stage. Calling this method will cause GPU buffers update in the next render queue update.