Skip to content

Commit

Permalink
creature and creatureStick progress
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartPiece44 committed Jan 6, 2025
1 parent d1f794b commit b54a3c0
Show file tree
Hide file tree
Showing 41 changed files with 1,065 additions and 2,570 deletions.
44 changes: 32 additions & 12 deletions include/Collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,32 @@ struct CollPart {
ID32 getCode();
Matrix4f getMatrix();
void update(struct Graphics&, bool);
void collide(CollPart*, struct Vector3f&);
bool collide(CollPart*, struct Vector3f&);
void makeTube(struct Tube&);

// unused/inlined:
bool isDamagable();
CollPart* getNext();
void collide(Creature*, Vector3f&);
void collide(Vector3f&, f32, Vector3f&);
bool collide(Creature*, Vector3f&);
bool collide(Vector3f&, f32, Vector3f&);
void makeSphere(struct Sphere&);
void makeCylinder(struct Cylinder&);
void samePlatShape(Shape*);
bool samePlatShape(Shape*);

inline bool isTubeLike() { return mPartType == PART_Tube || mPartType == PART_TubeChild; } // based on P2, maybe isTubeLike? who knows
bool isTubeType() { return mPartType == PART_Tube || mPartType == PART_TubeChild; } // based on P2, maybe isTubeLike? who knows

bool isPlatformType() { return mPartType == PART_Platform; }

/*
DLL inlines to make:
bool isBouncySphereType();
bool isCollisionType();
bool isPlatformType();
bool isReferenceType();
bool isSphereType();
Matrix4f getJointMatrix();
*/

f32 mRadius; // _00
Vector3f mCentre; // _04
Expand All @@ -158,9 +171,16 @@ struct CollPart {
* @brief TODO
*/
struct CollEvent {
Creature* mCollider; // _00
CollPart* mCollPart; // _04
u32 _08; // _08, unknown
CollEvent(Creature* collider, CollPart* colliderPart, CollPart* selfPart)
{
mCollider = collider;
mColliderPart = colliderPart;
mSelfPart = selfPart;
}

Creature* mCollider; // _00
CollPart* mColliderPart; // _04
CollPart* mSelfPart; // _08
};

/**
Expand Down Expand Up @@ -194,15 +214,15 @@ struct CollInfo {
void enableStick();
void disableStick();
void checkCollisionSpecial(Vector3f&, f32, CndCollPart*);
void checkCollision(Creature*, Vector3f&);
void checkCollisionRec(Creature*, int, Vector3f&);
void checkCollision(CollInfo*, CollPart**, CollPart**, Vector3f&);
CollPart* checkCollision(Creature*, Vector3f&);
CollPart* checkCollisionRec(Creature*, int, Vector3f&);
bool checkCollision(CollInfo*, CollPart**, CollPart**, Vector3f&);
void checkCollisionRec(CollInfo*, int, int, CollPart**, CollPart**, Vector3f&);
CollPart* getBoundingSphere();
CollPart* getSphere(u32 id);
CollPart* getNearestCollPart(Vector3f&, u32);
CollPart* getRandomCollPart(u32);
void getPlatform(DynCollObject*);
CollPart* getPlatform(DynCollObject*);
void updateInfo(Graphics&, bool);
bool hasInfo();
void initInfo(Shape*, CollPart*, u32*);
Expand Down
15 changes: 9 additions & 6 deletions include/ComplexCreature.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#define _COMPLEXCREATURE_H

#include "types.h"
#include "Creature.h"

struct Creature;
struct CreatureProp;

/**
* @brief TODO
*
* @note Mostly stripped, very few references left. Necessary for complexCreature.cpp though.
* @note Mostly stripped, but necessary. This is the complete set of inlines from the DLL.
*/
template <typename T>
struct SmartPtr {
Expand All @@ -32,10 +34,11 @@ struct SmartPtr {
}
}

// also need:
// void clear();
// bool isNull();
// T* getPtr();
T* getPtr() { return mPtr; }

bool isNull() { return mPtr == nullptr; }

void clear() { mPtr = nullptr; }

T* mPtr; // _00
};
Expand Down
1 change: 0 additions & 1 deletion include/Condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct CndIsAtari : public Condition {
virtual bool satisfy(Creature*); // _08

// _00 = VTBL
// TODO: members
};

/**
Expand Down
Loading

0 comments on commit b54a3c0

Please sign in to comment.