named UpdateState flags

This commit is contained in:
Adam Jensen 2023-06-19 02:26:30 +01:00
parent 5af34c4a5a
commit c7157077cc
2 changed files with 38 additions and 4 deletions

View File

@ -10,6 +10,15 @@ class ISceneCellGroup;
class ISceneEntity {
public:
struct UpdateState {
static const uint32_t kEnabled = 1;
static const uint32_t kDrawable = 2;
static const uint32_t kCellGroup = 4;
static const uint32_t kMatrix = 8;
static const uint32_t kMoveState = 16;
static const uint32_t kUpdateVolume = 32;
static const uint32_t kUpdateFlags = 64;
static const uint32_t kUpdateAll = 127;
uint32_t updateFlags;
bool enabled;
IDrawable *drawable;

View File

@ -13,11 +13,36 @@ SceneEntity::SceneEntity(Scene *scene) : scene(scene) {
void SceneEntity::ApplyUpdateState(UpdateState *updateState) {
// called from UpdateInstances
// without this, the object might still render in the correct position
// but QueryVolumeFromDrawable can't move the culling volume away from origin
// HACK
if (updateState && (updateState->updateFlags & 8))
// but TransformVolumeAndPivot can't move the culling volume away from origin
if (updateState->updateFlags & UpdateState::kEnabled) {
// TODO
}
if (updateState->updateFlags & UpdateState::kDrawable) {
// TODO
}
if (updateState->updateFlags & UpdateState::kCellGroup) {
// TODO
}
if (updateState->updateFlags & UpdateState::kMatrix) {
// TODO
setMatrix(updateState->matrix);
}
if (updateState->updateFlags & UpdateState::kMoveState) {
// TODO
}
if (updateState->updateFlags & (UpdateState::kUpdateVolume | UpdateState::kDrawable)) {
// TODO
}
if (updateState->updateFlags & (UpdateState::kUpdateFlags | UpdateState::kDrawable)) {
// TODO
}
}
void SceneEntity::setMatrix(Matrix& newMatrix) {