Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::ITransform Class Reference

Abstract interface for a generic transform. More...

#include <Transform.hpp>

Inheritance diagram for vl::ITransform:
vl::Object vl::TransformHierarchy< Transform > vl::TransformHierarchy< Ttype > vl::Transform vl::Billboard

List of all members.

Public Member Functions

 ITransform ()
virtual size_t childrenCount () const =0
virtual ITransformgetChildren (size_t i)=0
virtual const ITransformgetChildren (size_t i) const =0
virtual ITransformparent ()=0
virtual const ITransformparent () const =0
void setLocalMatrix (const mat4 &m)
 The matrix representing the transform's local space.
const mat4localMatrix () const
 The matrix representing the transform's local space.
virtual void computeWorldMatrix (Camera *=NULL)
 Computes the world matrix by concatenating the parent's world matrix with its own local matrix.
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.
mat4 getComputedWorldMatrix ()
 Returns the matrix computed concatenating this Transform's local matrix with the local matrices of all its parents.
const mat4worldMatrix () const
 Returns the world matrix used for rendering.
void setWorldMatrix (const mat4 &matrix)
 Normally you should not use directly this function, call it only if you are sure you cannot do otherwise.
long long worldMatrixUpdateTick () const
 Returns the internal update tick used to avoid unnecessary computations.
void setAssumeIdentityWorldMatrix (bool assume_I)
 If set to true the world matrix of this transform will always be considered and identity.
bool assumeIdentityWorldMatrix ()
 If set to true the world matrix of this transform will always be considered and identity.
bool hasDuplicatedChildren () const
 Checks whether there are duplicated entries in the Transform's children list.

Protected Attributes

mat4 mLocalMatrix
mat4 mWorldMatrix
long long mWorldMatrixUpdateTick
bool mAssumeIdentityWorldMatrix

Detailed Description

Abstract interface for a generic transform.

Definition at line 56 of file Transform.hpp.


Constructor & Destructor Documentation

vl::ITransform::ITransform (  ) [inline]

Definition at line 59 of file Transform.hpp.


Member Function Documentation

virtual size_t vl::ITransform::childrenCount (  ) const [pure virtual]
virtual ITransform* vl::ITransform::getChildren ( size_t  i ) [pure virtual]
virtual const ITransform* vl::ITransform::getChildren ( size_t  i ) const [pure virtual]
virtual ITransform* vl::ITransform::parent (  ) [pure virtual]
virtual const ITransform* vl::ITransform::parent (  ) const [pure virtual]
void vl::ITransform::setLocalMatrix ( const mat4 m ) [inline]

The matrix representing the transform's local space.

After calling this you might want to call computeWorldMatrix() or computeWorldMatrixRecursive().

Definition at line 78 of file Transform.hpp.

Referenced by vl::Transform::rotate(), vl::Transform::scale(), vl::Billboard::setPosition(), and vl::Transform::translate().

const mat4& vl::ITransform::localMatrix (  ) const [inline]

The matrix representing the transform's local space.

Definition at line 84 of file Transform.hpp.

Referenced by vl::Billboard::position(), vl::Transform::rotate(), vl::Transform::scale(), and vl::Transform::translate().

virtual void vl::ITransform::computeWorldMatrix ( Camera = NULL ) [inline, virtual]

Computes the world matrix by concatenating the parent's world matrix with its own local matrix.

Reimplemented in vl::Billboard.

Definition at line 90 of file Transform.hpp.

Referenced by vl::TrackballManipulator::adjustView().

void vl::ITransform::computeWorldMatrixRecursive ( Camera camera = NULL ) [inline]

Computes the world matrix by concatenating the parent's world matrix with its local matrix, recursively descending to the children.

Definition at line 107 of file Transform.hpp.

Referenced by vl::Rendering::render().

mat4 vl::ITransform::getComputedWorldMatrix (  ) [inline]

Returns the matrix computed concatenating this Transform's local matrix with the local matrices of all its parents.

Definition at line 115 of file Transform.hpp.

const mat4& vl::ITransform::worldMatrix (  ) const [inline]
void vl::ITransform::setWorldMatrix ( const mat4 matrix ) [inline]

Normally you should not use directly this function, call it only if you are sure you cannot do otherwise.

Usually you want to call computeWorldMatrix() or computeWorldMatrixRecursive(). Calling this function will also increment the worldMatrixUpdateTick().

Definition at line 136 of file Transform.hpp.

Referenced by vl::Billboard::computeWorldMatrix().

long long vl::ITransform::worldMatrixUpdateTick (  ) const [inline]

Returns the internal update tick used to avoid unnecessary computations.

The world matrix thick gets incremented every time the setWorldMatrix() or setLocalAndWorldMatrix() functions are called.

Definition at line 144 of file Transform.hpp.

Referenced by vl::Actor::boundsDirty(), and vl::Actor::computeBounds().

void vl::ITransform::setAssumeIdentityWorldMatrix ( bool  assume_I ) [inline]

If set to true the world matrix of this transform will always be considered and identity.

Is usually used to save calculations for top Transforms with many sub-Transforms.

Definition at line 148 of file Transform.hpp.

bool vl::ITransform::assumeIdentityWorldMatrix (  ) [inline]

If set to true the world matrix of this transform will always be considered and identity.

Is usually used to save calculations for top Transforms with many sub-Transforms.

Definition at line 152 of file Transform.hpp.

Referenced by vl::Billboard::computeWorldMatrix().

bool vl::ITransform::hasDuplicatedChildren (  ) const [inline]

Checks whether there are duplicated entries in the Transform's children list.

Definition at line 155 of file Transform.hpp.


Member Data Documentation

Definition at line 174 of file Transform.hpp.

Definition at line 175 of file Transform.hpp.

Definition at line 176 of file Transform.hpp.

Definition at line 177 of file Transform.hpp.


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

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:36.
Permission is granted to use this page to write and publish articles regarding Visualization Library.