Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | List of all members
vl::Billboard Class Reference

A Transform that aligns an Actor towards the camera. More...

#include <Billboard.hpp>

+ Inheritance diagram for vl::Billboard:

Public Member Functions

 Billboard ()
 
void setPosition (const vec3 &pos)
 The billboard position and rotation center. More...
 
void setPosition (real x, real y, real z)
 The billboard position and rotation center. More...
 
vec3 position ()
 The billboard position and rotation center. More...
 
void setAxis (const vec3 &axis)
 The rotation axis in world coordinates. Used only for axis aligned billboards. More...
 
const vec3axis () const
 The rotation axis in world coordinates. Used only for axis aligned billboards. More...
 
void setNormal (const vec3 &normal)
 Used only for axis aligned billboards. More...
 
const vec3normal () const
 Used only for axis aligned billboards. More...
 
virtual void computeWorldMatrix (Camera *camera=NULL)
 Computes the world matrix by concatenating the parent's world matrix with its own local matrix. More...
 
EBillboardType type () const
 The type of the billboard. More...
 
void setType (EBillboardType type)
 The type of the billboard. More...
 
- Public Member Functions inherited from vl::Transform
 Transform ()
 Constructor. More...
 
 Transform (const mat4 &matrix)
 Constructor. More...
 
 ~Transform ()
 Destructor. More...
 
const Transformparent () const
 Returns the parent Transform. More...
 
Transformparent ()
 Returns the parent Transform. More...
 
void translate (real x, real y, real z)
 Utility function equivalent to setLocalMatrix( mat4::getTranslation(x,y,z)*localMatrix() ). More...
 
void translate (const vec3 &t)
 Utility function equivalent to setLocalMatrix( mat4::getTranslation(t)*localMatrix() ). More...
 
void scale (real x, real y, real z)
 Utility function equivalent to setLocalMatrix( mat4::getScaling(x,y,z)*localMatrix() ). More...
 
void rotate (real degrees, real x, real y, real z)
 Utility function equivalent to setLocalMatrix( mat4::getRotation(degrees,x,y,z)*localMatrix() ). More...
 
void rotate (const vec3 &from, const vec3 &to)
 Utility function equivalent to setLocalMatrix( mat4::getRotation(from,to)*localMatrix() ). More...
 
void preMultiply (const mat4 &m)
 Utility function equivalent to setLocalMatrix( m*localMatrix() ). More...
 
void postMultiply (const mat4 &m)
 Utility function equivalent to setLocalMatrix( localMatrix()*m ). More...
 
void setLocalMatrix (const mat4 &m)
 The matrix representing the transform's local space. More...
 
const mat4localMatrix () const
 The matrix representing the transform's local space. More...
 
mat4localMatrix ()
 The matrix representing the transform's local space. More...
 
void setWorldMatrix (const mat4 &matrix)
 Normally you should not use directly this function, call it only if you are sure you cannot do otherwise. More...
 
const mat4worldMatrix () const
 Returns the world matrix used for rendering. More...
 
void setLocalAndWorldMatrix (const mat4 &matrix)
 Sets both the local and the world matrices. More...
 
long long worldMatrixUpdateTick () const
 Returns the internal update tick used to avoid unnecessary computations. More...
 
void setAssumeIdentityWorldMatrix (bool assume_I)
 If set to true the world matrix of this transform will always be considered and identity. More...
 
bool assumeIdentityWorldMatrix ()
 If set to true the world matrix of this transform will always be considered and identity. More...
 
void computeWorldMatrixRecursive (Camera *camera=NULL)
 Computes the world matrix by concatenating the parent's world matrix with its local matrix, recursively descending to the children. More...
 
mat4 getComputedWorldMatrix ()
 Returns the matrix computed concatenating this Transform's local matrix with the local matrices of all its parents. More...
 
const ref< Transform > * children () const
 Returns the array containing the child Transforms. More...
 
ref< Transform > * children ()
 Returns the array containing the child Transforms. More...
 
size_t childrenCount () const
 Returns the number of child Transform. More...
 
void addChild (Transform *child)
 Adds a child transform. More...
 
void addChildren (Transform *const *children, size_t count)
 Adds count children transforms. More...
 
void addChildren (const ref< Transform > *children, size_t count)
 
void addChildren (const std::vector< ref< Transform > > &children)
 
void addChildren (const std::vector< Transform * > &children)
 Adds the specified children transforms. More...
 
void setChild (int index, Transform *child)
 Sets the index-th child. More...
 
const TransformlastChild () const
 Returns the last child. More...
 
TransformlastChild ()
 Returns the last child. More...
 
void eraseChild (const Transform *child)
 Removes the given child Transform. More...
 
void eraseChildren (int index, int count)
 Removes count children Transforms starting at position index. More...
 
void eraseAllChildren ()
 Removes all the children of a Transform. More...
 
void eraseAllChildrenRecursive ()
 Removes all the children of a Transform recursively descending the hierarchy. More...
 
void flattenHierarchy ()
 Disassembles a hierarchy of Transforms like eraseAllChildrenRecursive() does plus assigns the local matrix to equal the world matrix. More...
 
void removeFromParent ()
 Erases a Transform from it's parent and sets the local matrix to be equal to the world matrix. More...
 
void shrink ()
 Minimizes the amount of memory used to store the children Transforms. More...
 
void shrinkRecursive ()
 Minimizes recursively the amount of memory used to store the children Transforms. More...
 
void reserveChildren (size_t count)
 Reserves space for count children. More...
 
bool hasDuplicatedChildren () const
 Checks whether there are duplicated entries in the Transform's children list. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Attributes

vec3 mAxis
 
vec3 mNormal
 
EBillboardType mType
 
- Protected Attributes inherited from vl::Transform
mat4 mLocalMatrix
 
mat4 mWorldMatrix
 
long long mWorldMatrixUpdateTick
 
bool mAssumeIdentityWorldMatrix
 
std::vector< ref< Transform > > mChildren
 
TransformmParent
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

A Transform that aligns an Actor towards the camera.

Definition at line 46 of file Billboard.hpp.

Constructor & Destructor Documentation

◆ Billboard()

Billboard::Billboard ( )

Definition at line 38 of file Billboard.cpp.

References vl::BT_SphericalBillboard, mType, setAxis(), and setNormal().

Member Function Documentation

◆ axis()

const vec3& vl::Billboard::axis ( ) const
inline

The rotation axis in world coordinates. Used only for axis aligned billboards.

Definition at line 61 of file Billboard.hpp.

Referenced by computeWorldMatrix().

◆ computeWorldMatrix()

void Billboard::computeWorldMatrix ( Camera = NULL)
virtual

◆ normal()

const vec3& vl::Billboard::normal ( ) const
inline

Used only for axis aligned billboards.

Definition at line 65 of file Billboard.hpp.

References NULL.

Referenced by computeWorldMatrix().

◆ position()

vec3 Billboard::position ( )

The billboard position and rotation center.

Definition at line 46 of file Billboard.cpp.

References vl::Matrix4< T_Scalar >::getT(), and vl::Transform::localMatrix().

Referenced by computeWorldMatrix().

◆ setAxis()

void vl::Billboard::setAxis ( const vec3 axis)
inline

The rotation axis in world coordinates. Used only for axis aligned billboards.

Definition at line 59 of file Billboard.hpp.

References vl::Vector3< T_Scalar >::normalize().

Referenced by Billboard().

◆ setNormal()

void vl::Billboard::setNormal ( const vec3 normal)
inline

Used only for axis aligned billboards.

Definition at line 63 of file Billboard.hpp.

References vl::Vector3< T_Scalar >::normalize().

Referenced by Billboard().

◆ setPosition() [1/2]

void Billboard::setPosition ( const vec3 pos)

The billboard position and rotation center.

Definition at line 51 of file Billboard.cpp.

References vl::Matrix4< float >::getTranslation(), and vl::Transform::setLocalMatrix().

◆ setPosition() [2/2]

void vl::Billboard::setPosition ( real  x,
real  y,
real  z 
)
inline

The billboard position and rotation center.

Definition at line 55 of file Billboard.hpp.

References setPosition().

Referenced by setPosition().

◆ setType()

void vl::Billboard::setType ( EBillboardType  type)
inline

The type of the billboard.

Definition at line 70 of file Billboard.hpp.

◆ type()

EBillboardType vl::Billboard::type ( ) const
inline

The type of the billboard.

Definition at line 68 of file Billboard.hpp.

Referenced by computeWorldMatrix().

Member Data Documentation

◆ mAxis

vec3 vl::Billboard::mAxis
protected

Definition at line 73 of file Billboard.hpp.

◆ mNormal

vec3 vl::Billboard::mNormal
protected

Definition at line 74 of file Billboard.hpp.

Referenced by computeWorldMatrix().

◆ mType

EBillboardType vl::Billboard::mType
protected

Definition at line 75 of file Billboard.hpp.

Referenced by Billboard().


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