mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-23 13:39:54 +00:00
implement SceneEntity::QueryVolumeFromDrawable
This commit is contained in:
parent
8702085502
commit
1b86c3cbc1
@ -1,3 +1,4 @@
|
||||
#include "IDrawable.h"
|
||||
#include "Scene.h"
|
||||
#include "SceneCell.h"
|
||||
#include "SceneCellGroup.h"
|
||||
@ -11,6 +12,7 @@ SceneEntity::SceneEntity(Scene *scene) : scene(scene) {
|
||||
|
||||
void SceneEntity::setMatrix(Matrix& newMatrix) {
|
||||
matrix = newMatrix;
|
||||
QueryVolumeFromDrawable();
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -20,6 +22,7 @@ Matrix& SceneEntity::getMatrix() {
|
||||
|
||||
void SceneEntity::setDrawable(IDrawable *newDrawable) {
|
||||
drawable = newDrawable;
|
||||
QueryVolumeFromDrawable();
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -36,7 +39,21 @@ void SceneEntity::setCellGroup(ISceneCellGroup *newICellGroup) {
|
||||
}
|
||||
}
|
||||
|
||||
void SceneEntity::UpdateData(bool reInitCell) {
|
||||
void SceneEntity::QueryVolumeFromDrawable() { // line 370
|
||||
if (drawable) {
|
||||
drawable->GetBoundingVolume(&cullingVolume);
|
||||
TransformVolumeAndPivot();
|
||||
// TODO
|
||||
} else {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
void SceneEntity::TransformVolumeAndPivot() { // line 406
|
||||
cullingVolume.Transform(matrix);
|
||||
}
|
||||
|
||||
void SceneEntity::UpdateData(bool reInitCell) { // line 464
|
||||
// HACK
|
||||
auto cell = sceneCellGroup->cellByIndex(0);
|
||||
if (reInitCell) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "ISceneEntity.h"
|
||||
#include "cdcMath/Math.h"
|
||||
#include "rendering/Culling/BasicPrimitives.h"
|
||||
|
||||
namespace cdc {
|
||||
|
||||
@ -16,7 +17,10 @@ public:
|
||||
Matrix matrix; // 20
|
||||
IDrawable *drawable = nullptr; // 6C
|
||||
SceneCellGroup *sceneCellGroup = nullptr; // 70
|
||||
BasicCullingVolume cullingVolume; // F0
|
||||
|
||||
void QueryVolumeFromDrawable();
|
||||
void TransformVolumeAndPivot();
|
||||
void UpdateData(bool);
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user