2020-11-21 16:14:40 +01:00
|
|
|
#pragma once
|
2022-12-28 06:47:44 +01:00
|
|
|
#include "maths.h"
|
2020-11-28 12:39:12 +01:00
|
|
|
#include "TPinballComponent.h"
|
|
|
|
|
2022-05-11 15:47:13 +02:00
|
|
|
struct vector2;
|
2021-01-06 15:06:13 +01:00
|
|
|
class TEdgeSegment;
|
2022-05-30 10:23:47 +02:00
|
|
|
class TBall;
|
2021-01-06 15:06:13 +01:00
|
|
|
|
2020-11-28 12:39:12 +01:00
|
|
|
class TCollisionComponent : public TPinballComponent
|
2020-11-21 16:14:40 +01:00
|
|
|
{
|
2020-11-28 12:39:12 +01:00
|
|
|
public:
|
2021-10-01 17:55:44 +02:00
|
|
|
std::vector<TEdgeSegment*> EdgeList;
|
2021-01-23 11:33:30 +01:00
|
|
|
float Elasticity;
|
|
|
|
float Smoothness;
|
|
|
|
float Boost;
|
|
|
|
float Threshold;
|
|
|
|
int SoftHitSoundId;
|
|
|
|
int HardHitSoundId;
|
2022-12-28 06:47:44 +01:00
|
|
|
RectF AABB;
|
2020-11-21 16:14:40 +01:00
|
|
|
|
2020-11-28 13:59:42 +01:00
|
|
|
TCollisionComponent(TPinballTable* table, int groupIndex, bool createWall);
|
2021-01-08 16:50:12 +01:00
|
|
|
~TCollisionComponent() override;
|
2020-11-29 16:50:49 +01:00
|
|
|
void port_draw() override;
|
2022-05-20 10:51:00 +02:00
|
|
|
virtual void Collision(TBall* ball, vector2* nextPosition, vector2* direction, float distance,
|
2021-01-06 15:06:13 +01:00
|
|
|
TEdgeSegment* edge);
|
2022-05-11 15:47:13 +02:00
|
|
|
virtual int FieldEffect(TBall* ball, vector2* vecDst);
|
2022-05-23 11:45:18 +02:00
|
|
|
bool DefaultCollision(TBall* ball, vector2* nextPosition, vector2* direction);
|
2020-11-28 12:39:12 +01:00
|
|
|
};
|