Reverse-engineered reimplementation of 3D Pinball for Windows - Space Cadet from k4zmu2a/SpaceCadetPinball (MIT), upstream cb9b7b8, vendored rather than submoduled so local patches are just edits. - CMakeLists: stop hard-setting CMAKE_OSX_ARCHITECTURES so the documented -D override works; brew's SDL2 is arm64-only and universal linking failed. - gitignore original .DAT/.MID assets, which are not ours to redistribute. - CLAUDE.md: build line, upstream deviation, and where game data goes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#pragma once
|
|
#include "maths.h"
|
|
#include "TCollisionComponent.h"
|
|
#include "TEdgeSegment.h"
|
|
|
|
class TBall : public TCollisionComponent, public TEdgeSegment
|
|
{
|
|
public :
|
|
TBall(TPinballTable* table, int groupIndex);
|
|
void Repaint();
|
|
void not_again(TEdgeSegment* edge);
|
|
bool already_hit(const TEdgeSegment& edge) const;
|
|
int Message(MessageCode code, float value) override;
|
|
vector2 get_coordinates() override;
|
|
void Disable();
|
|
void throw_ball(vector3* direction, float angleMult, float speedMult1, float speedMult2);
|
|
void place_in_grid(RectF* aabb) override {}
|
|
void EdgeCollision(TBall* ball, float distance) override;
|
|
float FindCollisionDistance(const ray_type& ray) override;
|
|
|
|
vector3 Position{};
|
|
vector3 PrevPosition{};
|
|
vector3 Direction{};
|
|
float Speed;
|
|
float RayMaxDistance;
|
|
float TimeDelta;
|
|
vector2 RampFieldForce{};
|
|
TCollisionComponent* CollisionComp;
|
|
int CollisionMask;
|
|
TEdgeSegment* Collisions[16]{};
|
|
int EdgeCollisionCount;
|
|
bool EdgeCollisionResetFlag{};
|
|
vector3 CollisionOffset{};
|
|
int CollisionFlag;
|
|
float Radius;
|
|
bool HasGroupFlag;
|
|
int StuckCounter = 0;
|
|
int LastActiveTime{};
|
|
float VisualZArray[50]{};
|
|
bool CollisionDisabledFlag{};
|
|
};
|