Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
A Transform that aligns an Actor towards the camera. More...
#include <Billboard.hpp>
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 vec3 & | axis () 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 vec3 & | normal () 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 Transform * | parent () const |
Returns the parent Transform. More... | |
Transform * | parent () |
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 mat4 & | localMatrix () const |
The matrix representing the transform's local space. More... | |
mat4 & | localMatrix () |
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 mat4 & | worldMatrix () 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 Transform * | lastChild () const |
Returns the last child. More... | |
Transform * | lastChild () |
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... | |
Object & | operator= (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... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () 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 |
Transform * | mParent |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
A Transform that aligns an Actor towards the camera.
Definition at line 46 of file Billboard.hpp.
Billboard::Billboard | ( | ) |
Definition at line 38 of file Billboard.cpp.
References vl::BT_SphericalBillboard, mType, setAxis(), and setNormal().
|
inline |
The rotation axis in world coordinates. Used only for axis aligned billboards.
Definition at line 61 of file Billboard.hpp.
Referenced by computeWorldMatrix().
Computes the world matrix by concatenating the parent's world matrix with its own local matrix.
Reimplemented from vl::Transform.
Definition at line 56 of file Billboard.cpp.
References vl::Transform::assumeIdentityWorldMatrix(), axis(), vl::BT_AxisAlignedBillboard, vl::BT_SphericalBillboard, vl::Transform::computeWorldMatrix(), vl::cross(), vl::dot(), vl::Matrix4< float >::getRotation(), vl::Matrix4< T_Scalar >::getT(), vl::Matrix4< float >::getTranslation(), vl::Matrix4< T_Scalar >::getY(), vl::Matrix4< T_Scalar >::getZ(), mNormal, vl::Camera::modelingMatrix(), normal(), vl::Vector3< T_Scalar >::normalize(), vl::normalize(), NULL, vl::Transform::parent(), position(), vl::Transform::setWorldMatrix(), vl::Matrix4< T_Scalar >::setX(), vl::Matrix4< T_Scalar >::setY(), vl::Matrix4< T_Scalar >::setZ(), type(), and vl::Transform::worldMatrix().
|
inline |
Used only for axis aligned billboards.
Definition at line 65 of file Billboard.hpp.
References NULL.
Referenced by computeWorldMatrix().
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().
|
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().
|
inline |
Used only for axis aligned billboards.
Definition at line 63 of file Billboard.hpp.
References vl::Vector3< T_Scalar >::normalize().
Referenced by Billboard().
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().
|
inline |
The billboard position and rotation center.
Definition at line 55 of file Billboard.hpp.
References setPosition().
Referenced by setPosition().
|
inline |
The type of the billboard.
Definition at line 70 of file Billboard.hpp.
|
inline |
The type of the billboard.
Definition at line 68 of file Billboard.hpp.
Referenced by computeWorldMatrix().
|
protected |
Definition at line 73 of file Billboard.hpp.
|
protected |
Definition at line 74 of file Billboard.hpp.
Referenced by computeWorldMatrix().
|
protected |
Definition at line 75 of file Billboard.hpp.
Referenced by Billboard().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:07.
© Copyright Michele Bosi. All rights reserved.