VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
makVrv::DtInstance Class Reference

Notion of a 'GPU' instance An instance has a model id, instance id and an absolute transform (32 bits). More...

Public Member Functions

 DtInstance ()
 CTOR.
 DtInstance (int modelId, int instanceId, const Matrix4_32 &xform)
 CTOR.
int id () const
 Get the id.
void setId (int instanceId)
 Set the id.
int modelId () const
 Get the model Id.
int visible (void) const
 Visibility.
void setVisible (int vis)
 Visibility.
int data (void) const
 Internal custom data.
void setData (int i)
 Internal custom data.
void setXForm (const Matrix4_32 &xform)
 Set/Update the transform.

Protected Attributes

Vector4_int myIds
Matrix4_32 myXForm

Detailed Description

Notion of a 'GPU' instance An instance has a model id, instance id and an absolute transform (32 bits).

An instance id can be set (using setId) and can be subsequently internally read/modified/used on the GPU (e.g. culling in compute shader). Transform may or may not be static. A DtInstance can be directly stored on the GPU (since its xform is 32 bit and its member layout is 4 byte-aligned such that its the exact same declaration in the shader. This is useful for things like indirect geometry. The layout of this class matches the equivalent structure in the indirect rendering shaders. Therefore, ***be CAREFUL if you extend/add variables to this class***, because you must change the corresponding structure in the shaders as well. Especially, be careful if you declare virtual methods/inherit this class (***best avoided***), because that will implicitly add 4/8 bytes for the vtable pointer that you need to account for in the shaders (not to mention, wasted GPU memory space)

Constructor & Destructor Documentation

makVrv::DtInstance::DtInstance ( )

CTOR.

makVrv::DtInstance::DtInstance ( int  modelId,
int  instanceId,
const Matrix4_32 xform 
)

CTOR.

Member Function Documentation

int makVrv::DtInstance::id ( ) const

Get the id.

void makVrv::DtInstance::setId ( int  instanceId)

Set the id.

int makVrv::DtInstance::modelId ( ) const

Get the model Id.

int makVrv::DtInstance::visible ( void  ) const

Visibility.

void makVrv::DtInstance::setVisible ( int  vis)

Visibility.

int makVrv::DtInstance::data ( void  ) const

Internal custom data.

void makVrv::DtInstance::setData ( int  i)

Internal custom data.

void makVrv::DtInstance::setXForm ( const Matrix4_32 xform)

Set/Update the transform.

Member Data Documentation

Vector4_int makVrv::DtInstance::myIds
protected
Matrix4_32 makVrv::DtInstance::myXForm
protected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)