]> git.tdb.fi Git - libs/game.git/commitdiff
Miscellaneous minor cleanups master
authorMikko Rasa <tdb@tdb.fi>
Tue, 22 Apr 2025 21:43:10 +0000 (00:43 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 22 Apr 2025 21:49:09 +0000 (00:49 +0300)
source/game/landscape.cpp
source/game/physicssystem.cpp
source/game/pool.cpp
source/game/transform.h
source/gameview/application.h

index 564443fa9851d2df4b32dff199ff6b84f26746ff..7be0fd1f990fbfcd0cad60d53e05246c413d2d95 100644 (file)
@@ -49,7 +49,7 @@ void Landscape::generate(const Geometry::BoundingBox<float, 2> &bounds)
                {
                        auto i = lower_bound(blocks, LinAl::Vector<int, 2>(x, y), block_index_compare);
                        if(i==blocks.end() || (*i)->index.y!=y || (*i)->index.x!=x)
                {
                        auto i = lower_bound(blocks, LinAl::Vector<int, 2>(x, y), block_index_compare);
                        if(i==blocks.end() || (*i)->index.y!=y || (*i)->index.x!=x)
-                               spawner.spawn<TerrainBlock>(string(), LinAl::Vector<float, 3>(x*block_size, y*block_size, 0.0f));
+                               spawner.spawn<TerrainBlock>(string(), {{ x*block_size, y*block_size, 0.0f }});
                }
 }
 
                }
 }
 
index 8464f1f6ec19de201fae3609c7626de31b0a87ea..a5de19d10d0dff5965412d5f8ff65051cc98e218 100644 (file)
@@ -6,7 +6,6 @@
 #include "rigidbody.h"
 #include "shape.h"
 #include "transform.h"
 #include "rigidbody.h"
 #include "shape.h"
 #include "transform.h"
-#include "transformpropagator.h"
 #include "weld.h"
 
 using namespace std;
 #include "weld.h"
 
 using namespace std;
@@ -167,12 +166,12 @@ void PhysicsSystem::tick(Time::TimeDelta dt)
                if(transform_changed)
                {
                        TransformValues tv = TransformValues::from_matrix(transform->get_world_transform().get_matrix());
                if(transform_changed)
                {
                        TransformValues tv = TransformValues::from_matrix(transform->get_world_transform().get_matrix());
-                       if(b.body->is_kinematic() && !motion_changed)
+                       if(kinematic && !motion_changed)
                                b.physics_body->move_kinematic(tv.position, tv.rotation, dt);
                        else
                                b.physics_body->set_transform(tv.position, tv.rotation);
 
                                b.physics_body->move_kinematic(tv.position, tv.rotation, dt);
                        else
                                b.physics_body->set_transform(tv.position, tv.rotation);
 
-                       if(b.body->is_kinematic() || !b.motion)
+                       if(kinematic || !b.motion)
                                b.transform_generation = transform->get_read_generation();
                }
 
                                b.transform_generation = transform->get_read_generation();
                }
 
index 427ea4f92b82349907c519f8330151a4e9681676..5a0291e73887af40e4d95dab81060fcb5e93367a 100644 (file)
@@ -160,7 +160,6 @@ void PoolBase::destroy(void *obj)
                throw invalid_argument("PoolBase::destroy");
 }
 
                throw invalid_argument("PoolBase::destroy");
 }
 
-
 int PoolBase::_destroy(void *obj)
 {
        unsigned block_index = 0;
 int PoolBase::_destroy(void *obj)
 {
        unsigned block_index = 0;
index 12bd8ab5f079986f055bead3c872e77ebf41872d..495334b3527631718bd08a0cb2b159f8383adade 100644 (file)
@@ -20,7 +20,7 @@ struct MSPGAME_API TransformValues
        TransformValues() = default;
        TransformValues(const LinAl::Vector<float, 3> &p): position(p) { }
        TransformValues(const LinAl::Vector<float, 3> &p, const Geometry::Quaternion<float> &r,
        TransformValues() = default;
        TransformValues(const LinAl::Vector<float, 3> &p): position(p) { }
        TransformValues(const LinAl::Vector<float, 3> &p, const Geometry::Quaternion<float> &r,
-               const LinAl::Vector<float, 3> &s = LinAl::Vector<float, 3>(1.0f, 1.0f, 1.0f)):
+               const LinAl::Vector<float, 3> &s = { 1.0f, 1.0f, 1.0f }):
                position(p), rotation(r), scale(s)
        { }
 
                position(p), rotation(r), scale(s)
        { }
 
index 9eeac84ed7da9d44d6f6c0e28e06f1825d5f0cca..752885e752272e93e950a70abb582f53d8289971 100644 (file)
@@ -43,6 +43,7 @@ public:
 protected:
        static GL::DeviceOptions create_gl_device_options(VR::System * = nullptr);
 
 protected:
        static GL::DeviceOptions create_gl_device_options(VR::System * = nullptr);
 
+public:
        int main() override;
 protected:
        void tick() override;
        int main() override;
 protected:
        void tick() override;