1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-17 23:20:19 +01:00
SpaceCadetPinball/SpaceCadetPinball/TEdgeManager.h

44 lines
1 KiB
C
Raw Normal View History

2020-12-20 12:13:12 +01:00
#pragma once
#include "TCollisionComponent.h"
struct ray_type;
2021-01-07 17:00:38 +01:00
class TEdgeBox;
2020-12-20 12:13:12 +01:00
struct field_effect_type
{
2022-05-20 10:51:00 +02:00
char* ActiveFlag;
int CollisionGroup;
2020-12-20 12:13:12 +01:00
TCollisionComponent* CollisionComp;
};
class TEdgeManager
{
public:
TEdgeManager(float xMin, float yMin, float width, float height);
2021-01-07 17:00:38 +01:00
~TEdgeManager();
void FieldEffects(TBall* ball, struct vector2* dstVec);
2021-01-07 17:00:38 +01:00
int box_x(float x);
int box_y(float y);
int increment_box_x(int x);
int increment_box_y(int y);
void add_edge_to_box(int x, int y, TEdgeSegment* edge);
void add_field_to_box(int x, int y, field_effect_type* field);
int TestGridBox(int x, int y, float* distPtr, TEdgeSegment** edgeDst, ray_type* ray, TBall* ball, int edgeIndex);
float FindCollisionDistance(ray_type* ray, TBall* ball, TEdgeSegment** edge);
vector2 NormalizeBox(vector2 pt) const;
vector2 DeNormalizeBox(vector2 pt) const;
2021-01-07 17:00:38 +01:00
float AdvanceX;
float AdvanceY;
int MaxBoxX;
int MaxBoxY;
float MinX;
float MinY;
float MaxX;
float MaxY;
float Width;
float Height;
2021-01-07 17:00:38 +01:00
TEdgeBox* BoxArray;
TEdgeSegment* EdgeArray[1000]{};
2020-12-20 12:13:12 +01:00
};