CR Feedback addressing

Signed-off-by: pereslav <pereslav@amazon.com>
This commit is contained in:
pereslav
2021-08-24 16:00:00 +01:00
parent 7d4f8e4281
commit 21605f15cc
4 changed files with 10 additions and 10 deletions
@@ -310,7 +310,7 @@ namespace AzPhysics
return group;
}
CollisionGroup MakeCollisionGroup(const CollisionGroups::Id& id)
CollisionGroup GetCollisionGroupById(const CollisionGroups::Id& id)
{
CollisionGroup group;
Physics::CollisionRequestBus::BroadcastResult(group, &Physics::CollisionRequests::GetCollisionGroupById, id);
@@ -174,8 +174,8 @@ namespace AzPhysics
AZStd::vector<Preset> m_groups;
};
//! Construct a Group with the given Id of a collision group.
//! Retrieves a Group with the given Id of a collision group.
//! This will lookup the group Id to retrieve the group mask. If not found, CollisionGroup::All is returned.
//! @param id The Id of the group to look up the group mask.
CollisionGroup MakeCollisionGroup(const CollisionGroups::Id& id);
CollisionGroup GetCollisionGroupById(const CollisionGroups::Id& id);
}
@@ -60,9 +60,9 @@ namespace PhysX
///This is an arbitary value used to verify the cast from void* userdata pointer on a pxActor to ActorData
///is safe. If m_sanity does not have this value, then it is not safe to use the casted pointer.
///Helps to debug if someone is setting userData pointer to something other than this class during development
static const AZ::u32 s_sanityValue = 0xba5eba11;
static constexpr AZ::u32 SanityValue = 0xba5eba11;
AZ::u32 m_sanity = s_sanityValue;
AZ::u32 m_sanity = SanityValue;
PxActorUniquePtr m_actor;
struct Payload
@@ -10,7 +10,6 @@
namespace PhysX
{
inline ActorData::ActorData(physx::PxActor* actor)
: m_sanity(s_sanityValue)
{
auto nullUserData = [](physx::PxActor* actorToSet)
{
@@ -23,23 +22,25 @@ namespace PhysX
}
inline ActorData::ActorData(ActorData&& other)
: m_sanity(s_sanityValue)
: m_sanity(other.m_sanity)
, m_actor(AZStd::move(other.m_actor))
, m_payload(AZStd::move(other.m_payload))
{
m_actor->userData = this;
}
inline ActorData& ActorData::operator=(ActorData&& other)
{
m_sanity = s_sanityValue;
m_sanity = other.m_sanity;
m_actor = AZStd::move(other.m_actor);
m_actor->userData = this;
m_payload = AZStd::move(other.m_payload);
return *this;
}
inline bool ActorData::IsValid() const
{
return m_sanity == s_sanityValue;
return m_sanity == SanityValue;
}
inline void ActorData::Invalidate()
@@ -136,5 +137,4 @@ namespace PhysX
return nullptr;
}
}
// ActorData END ********************************************************
} //namespace PhysX