REmoving comments

This commit is contained in:
samcake 2015-12-10 16:52:03 -08:00
parent dffb83a488
commit 20f3d6abe1
3 changed files with 14 additions and 28 deletions

View file

@ -277,16 +277,14 @@ namespace render {
using namespace render;
ModelMeshPartPayload::ModelMeshPartPayload(Model* model, int _meshIndex, int partIndex, int shapeIndex,
glm::vec3 position, glm::quat orientation) :
ModelMeshPartPayload::ModelMeshPartPayload(Model* model, int _meshIndex, int partIndex, int shapeIndex, const Transform& transform, const Transform& offsetTransform) :
_model(model),
_meshIndex(_meshIndex),
_shapeID(shapeIndex),
_modelPosition(position),
_modelOrientation(orientation) {
_shapeID(shapeIndex) {
auto& modelMesh = _model->_geometry->getMeshes().at(_meshIndex)->_mesh;
updateMeshPart(modelMesh, partIndex);
updateTransform(transform, offsetTransform);
initCache();
}
@ -314,11 +312,6 @@ void ModelMeshPartPayload::notifyLocationChanged() {
_model->_needsUpdateClusterMatrices = true;
}
void ModelMeshPartPayload::updateModelLocation(glm::vec3 position, glm::quat orientation) {
_modelPosition = position;
_modelOrientation = orientation;
}
render::ItemKey ModelMeshPartPayload::getKey() const {
ItemKey::Builder builder;
builder.withTypeShape();

View file

@ -73,30 +73,27 @@ namespace render {
class ModelMeshPartPayload : public MeshPartPayload {
public:
ModelMeshPartPayload(Model* model, int meshIndex, int partIndex, int shapeIndex, glm::vec3 position, glm::quat orientation);
ModelMeshPartPayload(Model* model, int meshIndex, int partIndex, int shapeIndex, const Transform& transform, const Transform& offsetTransform);
typedef render::Payload<ModelMeshPartPayload> Payload;
typedef Payload::DataPointer Pointer;
virtual void notifyLocationChanged();
virtual void updateModelLocation(glm::vec3 position, glm::quat orientation);
void notifyLocationChanged() override;
// Render Item interface
render::ItemKey getKey() const;
render::Item::Bound getBound() const;
void render(RenderArgs* args) const;
render::ItemKey getKey() const override;
render::Item::Bound getBound() const override;
void render(RenderArgs* args) const override;
// ModelMeshPartPayload functions to perform render
void bindMesh(gpu::Batch& batch) const;
void bindTransform(gpu::Batch& batch, const ModelRender::Locations* locations) const;
void bindMesh(gpu::Batch& batch) const override;
void bindTransform(gpu::Batch& batch, const ModelRender::Locations* locations) const override;
void initCache();
Model* _model;
int _meshIndex;
int _shapeID;
glm::vec3 _modelPosition;
glm::quat _modelOrientation;
bool _isSkinned = false;
bool _isBlendShaped = false;
};

View file

@ -503,9 +503,7 @@ bool Model::addToScene(std::shared_ptr<render::Scene> scene, render::PendingChan
foreach (auto renderItem, _renderItemsSet) {
auto item = scene->allocateID();
// auto renderData = MeshPartPayload::Pointer(renderItem);
auto renderData = renderItem;
auto renderPayload = std::make_shared<MeshPartPayload::Payload>(renderData);
auto renderPayload = std::make_shared<MeshPartPayload::Payload>(renderItem);
pendingChanges.resetItem(item, renderPayload);
pendingChanges.updateItem<MeshPartPayload>(item, [&](MeshPartPayload& data) {
data.notifyLocationChanged();
@ -532,8 +530,7 @@ bool Model::addToScene(std::shared_ptr<render::Scene> scene,
foreach (auto renderItem, _renderItemsSet) {
auto item = scene->allocateID();
auto renderData = MeshPartPayload::Pointer(renderItem);
auto renderPayload = std::make_shared<MeshPartPayload::Payload>(renderData);
auto renderPayload = std::make_shared<MeshPartPayload::Payload>(renderItem);
renderPayload->addStatusGetters(statusGetters);
pendingChanges.resetItem(item, renderPayload);
pendingChanges.updateItem<MeshPartPayload>(item, [&](MeshPartPayload& data) {
@ -1185,7 +1182,7 @@ void Model::segregateMeshGroups() {
_renderItemsSet << std::make_shared<MeshPartPayload>(networkMesh._mesh, partIndex, ModelRender::getCollisionHullMaterial(), transform, offset);
} else {
_renderItemsSet << std::make_shared<ModelMeshPartPayload>(this, i, partIndex, shapeID, _translation, _rotation);
_renderItemsSet << std::make_shared<ModelMeshPartPayload>(this, i, partIndex, shapeID, transform, offset);
}
shapeID++;
@ -1210,8 +1207,7 @@ bool Model::initWhenReady(render::ScenePointer scene) {
foreach (auto renderItem, _renderItemsSet) {
auto item = scene->allocateID();
auto renderData = MeshPartPayload::Pointer(renderItem);
auto renderPayload = std::make_shared<MeshPartPayload::Payload>(renderData);
auto renderPayload = std::make_shared<MeshPartPayload::Payload>(renderItem);
_renderItems.insert(item, renderPayload);
pendingChanges.resetItem(item, renderPayload);
pendingChanges.updateItem<MeshPartPayload>(item, [&](MeshPartPayload& data) {