Changeset b7fc3c2 in opengl-game for sdl-game.hpp
- Timestamp:
- Jun 10, 2021, 2:58:54 PM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- c1ec4f6
- Parents:
- bb76950
- git-author:
- Dmitry Portnoy <dportnoy@…> (06/10/21 14:53:52)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (06/10/21 14:58:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sdl-game.hpp
rbb76950 rb7fc3c2 323 323 void centerObject(SceneObject<VertexType, SSBOType>& object); 324 324 325 template<class VertexType, class SSBOType>326 void updateObject(SceneObject<VertexType, SSBOType>& obj);327 328 325 void renderFrame(ImDrawData* draw_data); 329 326 void presentFrame(); … … 353 350 } 354 351 355 // TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model 356 // and to change the model matrix later by setting model_transform and then calling updateObject()352 // TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model and to change 353 // the model matrix later by setting model_transform and then calculating the new ssbo.model. 357 354 // Figure out a better way to allow the model matrix to be set during object creation 358 355 template<class VertexType, class SSBOType> … … 362 359 VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo) { 363 360 // TODO: Use the model field of ssbo to set the object's model_base 364 // currently, the passed in model is useless since it gets overridden in updateObject() anyway361 // currently, the passed-in model is useless since it gets overridden when ssbo.model is recalculated 365 362 size_t numVertices = pipeline.getNumVertices(); 366 363 … … 464 461 } 465 462 466 // TODO: Just pass in the single object instead of a list of all of them467 template<class VertexType, class SSBOType>468 void VulkanGame::updateObject(SceneObject<VertexType, SSBOType>& obj) {469 obj.ssbo.model = obj.model_transform * obj.model_base;470 obj.center = vec3(obj.ssbo.model * vec4(0.0f, 0.0f, 0.0f, 1.0f));471 472 obj.modified = false;473 }474 475 463 #endif // _SDL_GAME_H
Note:
See TracChangeset
for help on using the changeset viewer.