-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to cleanup the char folder, get more TUs Equivalent (#324)
* charuppertwist equivalent * charsleeve work * charservobone work * charpollgroup sortpolls * match charpollgroup * charnecktwist poll * charbone is equivalent * charguitarstring is equivalent * charmirror attempt * charinterest work * charikfoot work * charforetwist poll tweak * chareyes work * more chareyes work * charhair work * charcollide work * charcollide tweaks * charcollide highlight work * charcollide tweaks * more charactertest work * charactertest symbols * charutl work * charutl is equivalent * correct angle func name * waypoint work * waypoint symbols in retail * waypoint work * clipcollide work * more clipcollide work * clipgraphgen work * no charforetwist enter
- Loading branch information
Showing
56 changed files
with
1,853 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,146 @@ | ||
#include "char/CharCollide.h" | ||
#include "rndobj/Utl.h" | ||
#include "utl/Symbols.h" | ||
|
||
CharCollide::CharCollide() : mShape(kSphere), mFlags(0), mMesh(this, 0) { | ||
INIT_REVS(CharCollide) | ||
|
||
CharCollide::CharCollide() : mShape(kSphere), mFlags(0), mMesh(this, 0), mMeshYBias(0) { | ||
for(int i = 0; i < 2; i++){ | ||
mOrigLength[i] = 0; | ||
mOrigRadius[i] = 0; | ||
} | ||
CopyOriginalToCur(); | ||
for(int i = 0; i < 8; i++){ | ||
unk_structs[i].unk0 = 0; | ||
unk_structs[i].vec.Zero(); | ||
} | ||
unk148.Reset(); | ||
} | ||
|
||
// ObjPtr<>::ObjPtr((ObjPtr<> *)(this + 0x98),(Object *)pCVar1,(RndMesh *)0x0); | ||
// pCVar1 = this + 0xb8; | ||
// do { | ||
// RSONotifyModuleLoaded(pCVar1); | ||
// pCVar1 = pCVar1 + 0x10; | ||
// } while (pCVar1 < this + 0x138); | ||
// Transform::Transform(this + 0x148); | ||
// this[0x188] = (CharCollide)0x0; | ||
// iVar3 = 2; | ||
// iVar2 = 0; | ||
// do { | ||
// *(undefined4 *)(this + iVar2 + 0x140) = 0; | ||
// *(undefined4 *)(this + iVar2 + 0x138) = 0; | ||
// iVar3 = iVar3 + -1; | ||
// iVar2 = iVar2 + 4; | ||
// } while (iVar3 != 0); | ||
// fn_804C3484(this); // copy original to cur | ||
// iVar2 = 0; | ||
// iVar3 = 0; | ||
// do { | ||
// *(undefined4 *)(this + iVar3 + 0xb8) = 0; | ||
// Vector3::Zero((Vector3 *)(this + iVar3 + 0xbc)); | ||
// iVar2 = iVar2 + 1; | ||
// iVar3 = iVar3 + 0x10; | ||
// } while (iVar2 < 8); | ||
|
||
// Transform::Reset(this + 0x148); | ||
|
||
// *(undefined4 *)(this + 0xb8) = 0; | ||
// *(float *)(this + 0xc4) = 0.0; | ||
// *(float *)(this + 0xc0) = 0.0; | ||
// *(float *)(this + 0xbc) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0xc8) = 0; | ||
// *(float *)(this + 0xd4) = 0.0; | ||
// *(float *)(this + 0xd0) = 0.0; | ||
// *(float *)(this + 0xcc) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0xd8) = 0; | ||
// *(float *)(this + 0xe4) = 0.0; | ||
// *(float *)(this + 0xe0) = 0.0; | ||
// *(float *)(this + 0xdc) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0xe8) = 0; | ||
// *(float *)(this + 0xf4) = 0.0; | ||
// *(float *)(this + 0xf0) = 0.0; | ||
// *(float *)(this + 0xec) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0xf8) = 0; | ||
// *(float *)(this + 0x104) = 0.0; | ||
// *(float *)(this + 0x100) = 0.0; | ||
// *(float *)(this + 0xfc) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0x108) = 0; | ||
// *(float *)(this + 0x114) = 0.0; | ||
// *(float *)(this + 0x110) = 0.0; | ||
// *(float *)(this + 0x10c) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0x118) = 0; | ||
// *(float *)(this + 0x124) = 0.0; | ||
// *(float *)(this + 0x120) = 0.0; | ||
// *(float *)(this + 0x11c) = 0.0; | ||
|
||
// *(undefined4 *)(this + 0x128) = 0; | ||
// *(float *)(this + 0x134) = 0.0; | ||
// *(float *)(this + 0x130) = 0.0; | ||
// *(float *)(this + 0x12c) = 0.0; | ||
|
||
CharCollide::~CharCollide(){ | ||
|
||
} | ||
|
||
SAVE_OBJ(CharCollide, 0x58) | ||
void CharCollide::Highlight(){ | ||
Hmx::Color black(1.0f, 1.0f, 1.0f); | ||
Hmx::Color red(1.0f, 0.0f, 0.0f); | ||
switch(mShape){ | ||
case kPlane: | ||
Plane p(WorldXfm().v, WorldXfm().m.x); | ||
UtilDrawPlane(p, WorldXfm().v, red, 1, 12.0f); | ||
break; | ||
case kSphere: | ||
case kInsideSphere: | ||
UtilDrawSphere(WorldXfm().v, mOrigRadius[0], red); | ||
UtilDrawSphere(WorldXfm().v, mCurRadius[0], black); | ||
break; | ||
case kCigar: | ||
case kInsideCigar: | ||
UtilDrawCigar(WorldXfm(), mOrigRadius, mOrigLength, red, 8); | ||
UtilDrawCigar(WorldXfm(), mCurRadius, mCurLength, black, 8); | ||
break; | ||
default: break; | ||
} | ||
if(mMesh){ | ||
int numspheres = NumSpheres(); | ||
for(int i = 0; i < numspheres * 2; i++){ | ||
UtilDrawSphere(mMesh->VertPos(unk_structs[i].unk0), 0.1f, Hmx::Color(0.0f, 0.0f, 1.0f)); | ||
} | ||
} | ||
} | ||
|
||
SAVE_OBJ(CharCollide, 0x58) | ||
|
||
BEGIN_LOADS(CharCollide) | ||
LOAD_REVS(bs) | ||
ASSERT_REVS(7, 0) | ||
LOAD_SUPERCLASS(Hmx::Object) | ||
LOAD_SUPERCLASS(RndTransformable) | ||
bs >> (int&)mShape; | ||
bs >> mOrigRadius[0]; | ||
if(gRev > 4) bs >> mOrigLength[0]; | ||
if(gRev > 2) bs >> mOrigLength[1]; | ||
if(gRev > 1) bs >> mFlags; | ||
else mFlags = 0; | ||
if(gRev > 3) bs >> mCurRadius[0]; | ||
else mCurRadius[0] = mOrigRadius[0]; | ||
|
||
if(gRev > 5){ | ||
bs >> mOrigRadius[1]; | ||
bs >> mCurRadius[1]; | ||
bs >> mCurLength[0]; | ||
bs >> mCurLength[1]; | ||
bs >> unk148; | ||
bs >> mMesh; | ||
for(int i = 0; i < 8; i++){ | ||
bs >> unk_structs[i].unk0; | ||
bs >> unk_structs[i].vec; | ||
} | ||
bs >> mDigest; | ||
bs >> mMeshYBias; | ||
if(gRev < 7) CopyOriginalToCur(); | ||
} | ||
else { | ||
mOrigRadius[1] = mOrigRadius[0]; | ||
CopyOriginalToCur(); | ||
} | ||
END_LOADS | ||
|
||
BEGIN_COPYS(CharCollide) | ||
COPY_SUPERCLASS(Hmx::Object) | ||
COPY_SUPERCLASS(RndTransformable) | ||
CREATE_COPY(CharCollide) | ||
BEGIN_COPYING_MEMBERS | ||
COPY_MEMBER(mShape) | ||
COPY_MEMBER(mFlags) | ||
memcpy(mOrigRadius, c->mOrigRadius, 8); | ||
memcpy(mOrigLength, c->mOrigLength, 8); | ||
memcpy(mCurRadius, c->mCurRadius, 8); | ||
memcpy(mCurLength, c->mCurLength, 8); | ||
COPY_MEMBER(unk148) | ||
COPY_MEMBER(mMeshYBias) | ||
COPY_MEMBER(mMesh) | ||
END_COPYING_MEMBERS | ||
END_COPYS | ||
|
||
void CharCollide::Deform(){ | ||
|
||
} | ||
|
||
int CharCollide::NumSpheres(){ | ||
if(mShape == kCigar || mShape == kInsideCigar) return 2; | ||
else if (mShape == kSphere || mShape == kInsideSphere) return 1; | ||
else return 0; | ||
} | ||
|
||
void CharCollide::CopyOriginalToCur(){ | ||
memcpy(mCurRadius, mOrigRadius, 8); | ||
memcpy(mCurLength, mOrigLength, 8); | ||
} | ||
|
||
|
||
void CharCollide::SyncShape(){ | ||
f32 t = mCurLength[1]; | ||
if(mCurLength[0] > t){ | ||
mCurLength[0] = mCurLength[1]; | ||
} | ||
CopyOriginalToCur(); | ||
} | ||
|
||
BEGIN_HANDLERS(CharCollide) | ||
HANDLE_SUPERCLASS(RndTransformable) | ||
HANDLE_SUPERCLASS(Hmx::Object) | ||
HANDLE_CHECK(0x221) | ||
END_HANDLERS | ||
|
||
BEGIN_PROPSYNCS(CharCollide) | ||
SYNC_PROP_MODIFY(shape, (int&)mShape, SyncShape()) | ||
SYNC_PROP(flags, mFlags) | ||
SYNC_PROP_MODIFY(radius0, mOrigRadius[0], SyncShape()) | ||
SYNC_PROP_MODIFY(radius1, mOrigRadius[1], SyncShape()) | ||
SYNC_PROP_MODIFY(length0, mOrigLength[0], SyncShape()) | ||
SYNC_PROP_MODIFY(length1, mOrigLength[1], SyncShape()) | ||
SYNC_PROP_MODIFY_ALT(mesh, mMesh, SyncShape()) | ||
SYNC_PROP_MODIFY(mesh_y_bias, mMeshYBias, SyncShape()) | ||
SYNC_SUPERCLASS(RndTransformable) | ||
END_PROPSYNCS |
Oops, something went wrong.