![]() |
VR-Forces 4.6.1 Class Documentation
|
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 |
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)
| makVrv::DtInstance::DtInstance | ( | ) |
CTOR.
| makVrv::DtInstance::DtInstance | ( | int | modelId, |
| int | instanceId, | ||
| const Matrix4_32 & | xform | ||
| ) |
CTOR.
| 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.
|
protected |
|
protected |