Engine
spring.h
1 #ifndef SPRING_H
2 #define SPRING_H
3 
4 #include <physics_entity.h>
5 #include <memory>
6 #include <atomic>
10 struct Spring
11 {
12  private:
13  static std::atomic<GLint> next_id;
14 
15  public :
16  GLint id; // unique id for this spring
17  GLfloat k; // stiffness coefficent
18  GLfloat l0; // rest length
19  std::shared_ptr<PhysicsEntity> entity1_ptr;
20  std::shared_ptr<PhysicsEntity> entity2_ptr;
21 
25  Spring();
26 
34  Spring(GLfloat k, GLfloat l0, std::shared_ptr<PhysicsEntity> entity1_ptr, std::shared_ptr<PhysicsEntity> entity2_ptr);
35 };
36 #endif
Spring()
Definition: spring.cpp:5
data structure that represents a spring
Definition: spring.h:10