changed other type of collision to PhysicsEntity and added separation force
This commit is contained in:
		
							parent
							
								
									39625789e2
								
							
						
					
					
						commit
						8c78395219
					
				| 
						 | 
				
			
			@ -2,17 +2,19 @@
 | 
			
		|||
#define _fencer_collision_h
 | 
			
		||||
 | 
			
		||||
#include "shape.h"
 | 
			
		||||
#include "physics_entity.h"
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
struct Collision {
 | 
			
		||||
    Shape* other;
 | 
			
		||||
 | 
			
		||||
typedef struct Collision {
 | 
			
		||||
    PhysicsEntity other;
 | 
			
		||||
    Vector point;
 | 
			
		||||
    Vector normal;
 | 
			
		||||
    Vector velocity;
 | 
			
		||||
 | 
			
		||||
    Vector separation_force;
 | 
			
		||||
    size_t edge_left;
 | 
			
		||||
    size_t edge_right;
 | 
			
		||||
};
 | 
			
		||||
} Collision;
 | 
			
		||||
 | 
			
		||||
extern Collision get_collision(PhysicsEntity a, PhysicsEntity b);
 | 
			
		||||
 | 
			
		||||
#endif // !_fencer_collision_h
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue