Skip to content

Commit

Permalink
Made JoltPhysicsObject::GetName() functional
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 authored and Joshua-Ashton committed Oct 2, 2023
1 parent 50cef39 commit c63e521
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vphysics_jolt/vjolt_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ JoltPhysicsObject::JoltPhysicsObject( JPH::Body *pBody, JoltPhysicsEnvironment *
, m_pGameData( pParams->pGameData )
, m_materialIndex( Max( nMaterialIndex, 0 ) ) // Sometimes we get passed -1.
, m_flVolume( pParams->volume )
, m_pName( pParams->pName )
{
// Josh:
// Assert that m_pGameData is the first element, some games
Expand Down Expand Up @@ -916,8 +917,7 @@ const CPhysCollide *JoltPhysicsObject::GetCollide() const

const char *JoltPhysicsObject::GetName() const
{
// Slart: Jolt used to store debug names in JPH::Body, but it was removed. So now everybody's NoName.
return "NoName";
return m_pName;
}

//-------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions vphysics_jolt/vjolt_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class JoltPhysicsObject final : public IPhysicsObjectInterface
// remain un-named offset by the vtable to get to this
// instead of calling GetGameData().
void *m_pGameData = nullptr;
const char *m_pName = "NoName";

uint16 m_gameFlags = 0;
uint16 m_gameIndex = 0;
Expand Down

0 comments on commit c63e521

Please sign in to comment.