Kigs Framework  Doc version 0.8
Open source multi purpose Rapid Application Development framework
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Billboard3D Class Referenceabstract

#include <Billboard3D.h>

Inheritance diagram for Billboard3D:
Drawable SceneNode CoreModifiable GenericRefCountedBaseClass

Public Member Functions

 Billboard3D (const kstl::string &name, DECLARE_CLASS_NAME_TREE_ARG)
 constructor More...
 
virtual ~Billboard3D ()
 destructor
 
void SetTexture (Texture *TexPointer)
 add a texture More...
 
void SetPosition (const Point3D &Position)
 set the position More...
 
void SetSize (const kfloat &Width, const kfloat &Height)
 set the size More...
 
void SetTexCoord (const kfloat &u1, const kfloat &v1, const kfloat &u2, const kfloat &v2)
 set the texture position More...
 
void SetPositionAndSize (const Point3D &Position, const kfloat &Width, const kfloat &Height)
 set the position and the size More...
 
void SetColor (const kfloat &R, const kfloat &G, const kfloat &B, const kfloat &A)
 set the color More...
 
void SetAlpha (const kfloat &A)
 set the alpha value More...
 
void SetFatherNode (Node3D *pNode)
 set the father node More...
 
void GetSize (kfloat &w, kfloat &h)
 getter of the size (width and height) More...
 
const Point3D GetPosition ()
 getter of the position More...
 
Node3DGetFatherNode ()
 getter of the father node More...
 
- Public Member Functions inherited from Drawable
virtual void DoPreDraw (TravState *)
 pre draw method More...
 
virtual void DoDraw (TravState *travstate)
 draw method More...
 
virtual void DoPostDraw (TravState *travstate)
 post draw method More...
 
void CheckPostDraw (TravState *travstate)
 check before calling corresponding DoPredraw More...
 
virtual bool BBoxUpdate (kdouble time)
 update the bounding box More...
 
bool addItem (const CMSP &item, ItemPosition pos=Last) override
 add item in scene tree More...
 
bool removeItem (const CMSP &item) override
 remove item in scene tree More...
 
virtual void GetGlobalPosition (Matrix3x4 *pLocalToGlobal, kfloat &x, kfloat &y, kfloat &z)
 get the global position of the drawable More...
 
- Public Member Functions inherited from SceneNode
bool addItem (const CMSP &item, ItemPosition pos=Last DECLARE_DEFAULT_LINK_NAME) override
 add item at first or last position
 
- Public Member Functions inherited from CoreModifiable
void Init ()
 Modifiable managmenent.
 
void EmptyItemList ()
 remove all items (sons)
 
CMSP GetInstanceByPath (const std::string &path)
 return the instance corresponding to the given path in sons tree
 
std::string GetRuntimeID () const
 ID.
 
CoreModifiableAttributegetAttribute (KigsID labelid) const
 Attribute management.
 
u32 getNbArrayElements (KigsID attributeLabel) const
 return element count for an array type attribute
 
template<typename attribute_type , typename value_type >
attribute_type * AddDynamicAttribute (KigsID ID, const value_type &value)
 Dynamic attribute management.
 
const kigs::unordered_map< KigsID, ModifiableMethodStruct > * GetMethods ()
 Method management.
 
bool aggregateWith (CMSP &item, ItemPosition pos=Last)
 Aggregate management.
 
void flagAsNotificationCenterRegistered ()
 Flags.
 
void InitParametersFromList (const std::vector< CoreModifiableAttribute * > *params)
 Utility. More...
 
virtual void UninitModifiable ()
 called when InitModifiable has failled : reset read/write flag on all init params More...
 
virtual void ProtectedDestroy ()
 Destroy method decrement refcounter and delete instance if no more used. More...
 
virtual void addUser (CoreModifiable *user)
 add the given parent to list
 
virtual void removeUser (CoreModifiable *user)
 remove user (parent)
 

Protected Member Functions

virtual void PrepareVertexBufferPos ()=0
 prepare the vertex for the drawing More...
 
virtual void PrepareVertexBufferTex ()=0
 prepare the vertex of the texture for the drawing
 
virtual void PrepareVertexBufferCol ()=0
 prepare the vertex of the color for the drawing
 
void UpdateOrientation ()
 update the orientation far a specific camera More...
 
bool Draw (TravState *) override
 initialise draw method More...
 
 INSERT_FORWARDSP (TextureHandler, mTexturePointer)
 file name of the texture More...
 
- Protected Member Functions inherited from Drawable
void InitModifiable () override
 init the modifiable and set the _isInit flag to true if OK
 
virtual bool PreDraw (TravState *)
 initialise pre draw method More...
 
virtual bool PostDraw (TravState *)
 initialise PostDraw method More...
 
virtual void FatherNode3DNeedBoundingBoxUpdate ()
 update the father node bounding box
 
- Protected Member Functions inherited from CoreModifiable
void UpdateAggregates (const Timer &timer, void *addParam)
 Internals.
 
void Export (std::vector< CoreModifiable * > &savedList, XMLNode *currentNode, bool recursive, ExportSettings *settings)
 Export. More...
 
CoreModifiableAttributeGenericCreateDynamicAttribute (CoreModifiable::ATTRIBUTE_TYPE type, KigsID ID)
 create and add dynamic attribute except arrays
 

Protected Attributes

maVect3DF mPosition
 Center of BillBoard.
 
maFloat mWidth
 Size = Width,Height.
 
maFloat mHeight
 Size = Width,Height.
 
kfloat mU1
 Texture coordinate.
 
kfloat mV1
 Texture coordinate.
 
kfloat mU2
 Texture coordinate.
 
kfloat mV2
 Texture coordinate.
 
kfloat mColor [4]
 Color.
 
Vector3D mHorizontalVector
 Used To make the billboard Facing the Camera... Updated with UpdateOrientation.
 
Vector3D mVerticalVector
 Used To make the billboard Facing the Camera... Updated with UpdateOrientation.
 
kfloat mDistanceToCamera
 Used When Billboard Belongs to a BillboardGroup.
 
Node3DmFatherNode
 link to the father node
 
CameramCamera
 reference to Camera
 
maVect2DF mAnchor
 BillBoard Anchor point.
 
maBool mIsEnabled
 item is enable?
 
maFloat mRatio
 ratio between scene unit and pixel unit
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreModifiable
static std::vector< CMSP > GetRootInstances (const KigsID &cid, bool exactTypeOnly=false)
 static method : return the set of all root instances of the given type
 
static void Append (std::string &XMLString, const std::list< CoreModifiable * > &toexport, bool recursive, ExportSettings *settings=nullptr)
 static method to export the several CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static void Export (const std::string &filename, CoreModifiable *toexport, bool recursive=false, ExportSettings *settings=nullptr)
 static method to export the given CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static XMLNodeExportToXMLNode (CoreModifiable *toexport, XML *owner_xml_file, bool recursive, ExportSettings *settings=nullptr)
 static method to export the given CoreModifiable to an XML Node. if recursive flag is set to true, export also all sons tree More...
 
static std::string ExportToXMLString (CoreModifiable *toexport, bool recursive, ExportSettings *settings=nullptr)
 static method to export the given CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static void Export (std::string &XMLString, const std::list< CoreModifiable * > &toexport, bool recursive, ExportSettings *settings=nullptr)
 static method to export the several CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static CMSP Import (const std::string &filename, bool noInit=false, bool keepImportFileName=false, ImportState *state=nullptr, const std::string &override_name="")
 return an new CoreModifiable instance using the description found in XML file given by name
 
static CMSP GetInstanceByGlobalPath (const std::string &path)
 static method : return the instance corresponding to the given path, and given search start
 
static void debugPrintfFullTree (int maxindent=3)
 Editor. More...
 
- Static Protected Member Functions inherited from CoreModifiable
template<typename StringType >
static CMSP Import (XMLNodeTemplate< StringType > *currentNode, CoreModifiable *currentModifiable, ImportState &importState)
 recusrive method to add sons and attributes found in the XML file
 

Detailed Description

Billboard ( front facing camera texture ) object.

Obsolete

Constructor & Destructor Documentation

◆ Billboard3D()

Billboard3D::Billboard3D ( const kstl::string &  name,
DECLARE_CLASS_NAME_TREE_ARG   
)

constructor

Parameters
name: instance name
DECLARE_CLASS_NAME_TREE_ARG: list of arguments

Member Function Documentation

◆ Draw()

bool Billboard3D::Draw ( TravState _state)
overrideprotectedvirtual

initialise draw method

Parameters
TravState: camera state
Returns
TRUE if a could draw

Reimplemented from Drawable.

◆ GetFatherNode()

Node3D * Billboard3D::GetFatherNode ( )
inline

getter of the father node

Returns
the father node

◆ GetPosition()

const Point3D & Billboard3D::GetPosition ( )
inline

getter of the position

Returns
the position

◆ GetSize()

void Billboard3D::GetSize ( kfloat &  w,
kfloat &  h 
)
inline

getter of the size (width and height)

Parameters
w: receive the width
h: receive the height

◆ INSERT_FORWARDSP()

Billboard3D::INSERT_FORWARDSP ( TextureHandler  ,
mTexturePointer   
)
protected

file name of the texture

Pointer to a Texture... If ==NULL, Billboard should belong to a Billboard Group

◆ PrepareVertexBufferPos()

void Billboard3D::PrepareVertexBufferPos ( )
protectedpure virtual

prepare the vertex for the drawing


◆ SetAlpha()

void Billboard3D::SetAlpha ( const kfloat &  A)

set the alpha value

Parameters
A: alpha value (0 to 1)

◆ SetColor()

void Billboard3D::SetColor ( const kfloat &  R,
const kfloat &  G,
const kfloat &  B,
const kfloat &  A 
)

set the color

Parameters
R: red value (0 to 1)
G: green value (0 to 1)
B: blue value (0 to 1)
A: alpha value (0 to 1)

◆ SetFatherNode()

Billboard3D::SetFatherNode ( Node3D pNode)
inline

set the father node

Parameters
pNode: link to the father

◆ SetPosition()

void Billboard3D::SetPosition ( const Point3D &  Position)

set the position

Parameters
Position: new position

◆ SetPositionAndSize()

void Billboard3D::SetPositionAndSize ( const Point3D &  Position,
const kfloat &  Width,
const kfloat &  Height 
)

set the position and the size

Parameters
Position: new position
Width: new width
Height: new height

◆ SetSize()

void Billboard3D::SetSize ( const kfloat &  Width,
const kfloat &  Height 
)

set the size

Parameters
Width: new width
Height: new height

◆ SetTexCoord()

void Billboard3D::SetTexCoord ( const kfloat &  u1,
const kfloat &  v1,
const kfloat &  u2,
const kfloat &  v2 
)

set the texture position

Parameters
u1:
v1:
u2:
v2:

◆ SetTexture()

void Billboard3D::SetTexture ( Texture TexPointer)

add a texture

Parameters
TexPointer: new texture

◆ UpdateOrientation()

void Billboard3D::UpdateOrientation ( )
protected

update the orientation far a specific camera

Parameters
pCam: link to the camera

The documentation for this class was generated from the following files: