From a61758720db96f59e0fb82aab9f326d37e186a11 Mon Sep 17 00:00:00 2001 From: Stephen Simpson Date: Mon, 10 Oct 2011 16:04:33 -0500 Subject: got MountainGoomba to a working condition added Hermite Interpolation into linker and common.h added player.cpp and player.h for some common functions removed classic controller hack from NewerProject.yaml added more PSVEC functions to linker --- include/common.h | 4 ++++ include/game.h | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'include') diff --git a/include/common.h b/include/common.h index 2e7dc80..e212eb4 100644 --- a/include/common.h +++ b/include/common.h @@ -44,6 +44,8 @@ typedef struct { f32 x, y, z; } VEC3, Vec, *VecPtr, Point3d, *Point3dPtr; typedef struct { s16 x; s16 y; s16 z; }S16Vec, *S16VecPtr; typedef struct { f32 x, y, z, w; } Quaternion, *QuaternionPtr, Qtrn, *QtrnPtr; +typedef struct { f32 frame, value, slope; } HermiteKey; + extern "C" const char * strrchr ( const char * str, int character ); extern "C" int strcmp ( const char * str1, const char * str2 ); @@ -84,6 +86,8 @@ int memcmp(const void *ptr1, const void *ptr2, unsigned int num); void *AllocFromGameHeap1(u32 size); void FreeFromGameHeap1(void *block); +float GetHermiteCurveValue(float current_frame, HermiteKey* keys, unsigned int key_count); + /* Archive */ /*#ifdef REGION_PAL #define ARC_TABLE ((*((void**)0x8042A318))+4) diff --git a/include/game.h b/include/game.h index c57a93d..b6b07dd 100755 --- a/include/game.h +++ b/include/game.h @@ -2199,5 +2199,30 @@ inline u8 *getResource(const char *arcName, const char *fileName) { return GetRes((void*)(((u8*)DVDClass)+4), arcName, fileName); } +inline void scaleDown(Vec* scale, float amt) { scale->x -= amt; scale->y -= amt; scale->z -= amt; } +inline void scaleUp(Vec* scale, float amt) { scale->x -= amt; scale->y -= amt; scale->z -= amt; } +inline void setNewActivePhysicsRect(dStageActor_c* actor, Vec* scale) { + float amtX = scale->x; + float amtY = scale->y; + + ActivePhysics::Info info; + info.xDistToCenter = 0.0; + info.yDistToCenter = 3.0 * amtY; + info.xDistToEdge = 4.0 * amtX; + info.yDistToEdge = 4.0 * amtY; + + info.category1 = actor->aPhysics.info.category1; + info.category2 = actor->aPhysics.info.category2; + info.bitfield1 = actor->aPhysics.info.bitfield1; + info.bitfield2 = actor->aPhysics.info.bitfield2; + info.unkShort1C = actor->aPhysics.info.unkShort1C; + info.callback = actor->aPhysics.info.callback; + + OSReport("Making new Physics Class and adding to the list\n"); + actor->aPhysics.removeFromList(); + actor->aPhysics.initWithStruct(actor, &info); + actor->aPhysics.addToList(); +} + #endif -- cgit v1.2.3