Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a crash and a silly identified by Coverity. #851

Merged
merged 2 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Sources/Plasma/CoreLib/hsMatrix44.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct hsMatrix44 {

void DecompRigid(hsScalarTriple &translate, hsQuat &rotate) const;

[[nodiscard]]
static const hsMatrix44& IdentityMatrix();

// worldToCameras and cameraToWorlds are arrays of 6 matrices. Returned are LEFT,RIGHT,FRONT,BACK,TOP,BOTTOM.
Expand Down Expand Up @@ -118,6 +119,7 @@ struct hsMatrix44 {
hsVector3* GetTranslate(hsVector3 *pt) const;
hsPoint3* GetTranslate(hsPoint3 *pt) const
{ return (hsPoint3*)GetTranslate((hsVector3*)pt); }
[[nodiscard]]
const hsPoint3 GetTranslate() const { return hsPoint3(fMap[0][3], fMap[1][3], fMap[2][3]); }
void GetAxis(hsVector3* view, hsVector3 *up, hsVector3* right);
void GetAxisFromCamera(hsVector3* view, hsVector3 *up, hsVector3* right);
Expand All @@ -135,12 +137,15 @@ struct hsMatrix44 {
void MakeZRotation(float radians);


[[nodiscard]]
hsPoint3 operator*(const hsPoint3& p) const;
[[nodiscard]]
hsVector3 operator*(const hsVector3& p) const;
[[nodiscard]]
hsMatrix44 operator *(const hsMatrix44& other) const { return mat_mult.call(*this, other); }

hsPoint3* MapPoints(long count, hsPoint3 points[]) const;

bool IsIdentity();
void NotIdentity() { fFlags &= ~kIsIdent; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ bool plVolumeSensorConditionalObject::MsgReceive(plMessage* msg)
if (fHittee && fType == kTypeExit) {
const plSceneObject* hitteeSO = plSceneObject::ConvertNoRef(fHittee->ObjectIsLoaded());
if (hitteeSO && hitteeSO->IsLocallyOwned() == plSynchedObject::kYes) {
fLogicMod->GetNotify()->AddCollisionEvent(false, pActivateMsg->fHitterObj, pActivateMsg->fHiteeObj, false);
fLogicMod->GetNotify()->AddCollisionEvent(false, page->fPlayer, fHittee, false);
if (Satisfied())
fLogicMod->Trigger(false);
}
Expand Down
1 change: 0 additions & 1 deletion Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ void cyPhysics::Warp(pyPoint3& pos)
// create message
PyObject* matObj = pyMatrix44::New();
pyMatrix44* mat = pyMatrix44::ConvertFrom(matObj);
mat->fMatrix.IdentityMatrix();
zrax marked this conversation as resolved.
Show resolved Hide resolved
mat->fMatrix.SetTranslate(&pos.fPoint);
WarpMat(*mat);
Py_DECREF(matObj);
Expand Down