remove useless manual move/copy constructors/assignment operators (pls stop killing my hands bjarne)
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
#ifndef __PHYSICS_HPP_
|
||||
#define __PHYSICS_HPP_
|
||||
|
||||
#include "config.hpp"
|
||||
#include "puzzle.hpp"
|
||||
#include <raylib.h>
|
||||
#include <raymath.h>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "config.hpp"
|
||||
#include "puzzle.hpp"
|
||||
|
||||
class Mass {
|
||||
public:
|
||||
const float mass;
|
||||
@ -22,22 +23,6 @@ public:
|
||||
: mass(mass), position(position), previous_position(position),
|
||||
velocity(Vector3Zero()), force(Vector3Zero()), fixed(fixed) {}
|
||||
|
||||
Mass(const Mass ©)
|
||||
: mass(copy.mass), position(copy.position),
|
||||
previous_position(copy.previous_position), velocity(copy.velocity),
|
||||
force(copy.force), fixed(copy.fixed) {};
|
||||
|
||||
Mass &operator=(const Mass ©) = delete;
|
||||
|
||||
Mass(Mass &&move)
|
||||
: mass(move.mass), position(move.position),
|
||||
previous_position(move.previous_position), velocity(move.velocity),
|
||||
force(move.force), fixed(move.fixed) {};
|
||||
|
||||
Mass &operator=(Mass &&move) = delete;
|
||||
|
||||
~Mass() {}
|
||||
|
||||
public:
|
||||
auto ClearForce() -> void;
|
||||
|
||||
@ -62,30 +47,13 @@ public:
|
||||
: massA(massA), massB(massB), spring_constant(spring_constant),
|
||||
dampening_constant(dampening_constant), rest_length(rest_length) {}
|
||||
|
||||
Spring(const Spring ©)
|
||||
: massA(copy.massA), massB(copy.massB),
|
||||
spring_constant(copy.spring_constant),
|
||||
dampening_constant(copy.dampening_constant),
|
||||
rest_length(copy.rest_length) {};
|
||||
|
||||
Spring &operator=(const Spring ©) = delete;
|
||||
|
||||
Spring(Spring &&move)
|
||||
: massA(move.massA), massB(move.massB),
|
||||
spring_constant(move.spring_constant),
|
||||
dampening_constant(move.dampening_constant),
|
||||
rest_length(move.rest_length) {}
|
||||
|
||||
Spring &operator=(Spring &&move) = delete;
|
||||
|
||||
~Spring() {}
|
||||
|
||||
public:
|
||||
auto CalculateSpringForce() const -> void;
|
||||
};
|
||||
|
||||
class MassSpringSystem {
|
||||
private:
|
||||
// Uniform grid
|
||||
std::vector<Mass *> mass_pointers;
|
||||
std::vector<int> mass_indices;
|
||||
std::vector<int64_t> cell_ids;
|
||||
|
||||
Reference in New Issue
Block a user