Remove touchbending references in PhysX Gem (#3320)
* minor comments update Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
"TouchBend"
|
||||
{}
|
||||
]
|
||||
},
|
||||
"Groups": {
|
||||
|
||||
@@ -13,14 +13,6 @@
|
||||
|
||||
#include <AzFramework/Physics/CollisionBus.h>
|
||||
|
||||
//This bit is defined in the TouchBending Gem wscript.
|
||||
//Make sure the bit has a valid value.
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
#if (TOUCHBENDING_LAYER_BIT < 1) || (TOUCHBENDING_LAYER_BIT > 63)
|
||||
#error Invalid Bit Definition For the TouchBending Layer Bit
|
||||
#endif
|
||||
#endif //#ifdef TOUCHBENDING_LAYER_BIT
|
||||
|
||||
namespace AzPhysics
|
||||
{
|
||||
AZ_CLASS_ALLOCATOR_IMPL(CollisionGroup, AZ::SystemAllocator, 0);
|
||||
@@ -31,10 +23,6 @@ namespace AzPhysics
|
||||
const CollisionGroup CollisionGroup::None = 0x0000000000000000ULL;
|
||||
const CollisionGroup CollisionGroup::All = 0xFFFFFFFFFFFFFFFFULL;
|
||||
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
const CollisionGroup CollisionGroup::All_NoTouchBend = CollisionGroup::All.GetMask() & ~CollisionLayer::TouchBend.GetMask();
|
||||
#endif
|
||||
|
||||
void CollisionGroupScriptConstructor(CollisionGroup* thisPtr, AZ::ScriptDataContext& scriptDataContext)
|
||||
{
|
||||
if (int numArgs = scriptDataContext.GetNumArguments();
|
||||
|
||||
@@ -14,14 +14,6 @@
|
||||
|
||||
#include <AzFramework/Physics/CollisionBus.h>
|
||||
|
||||
//This bit is defined in the TouchBending Gem wscript.
|
||||
//Make sure the bit has a valid value.
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
#if (TOUCHBENDING_LAYER_BIT < 1) || (TOUCHBENDING_LAYER_BIT > 63)
|
||||
#error Invalid Bit Definition For the TouchBending Layer Bit
|
||||
#endif
|
||||
#endif //#ifdef TOUCHBENDING_LAYER_BIT
|
||||
|
||||
namespace AzPhysics
|
||||
{
|
||||
AZ_CLASS_ALLOCATOR_IMPL(CollisionLayer, AZ::SystemAllocator, 0);
|
||||
@@ -29,10 +21,6 @@ namespace AzPhysics
|
||||
|
||||
const CollisionLayer CollisionLayer::Default = 0;
|
||||
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
const CollisionLayer CollisionLayer::TouchBend = TOUCHBENDING_LAYER_BIT;
|
||||
#endif
|
||||
|
||||
void CollisionLayer::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
|
||||
@@ -32,12 +32,20 @@ namespace AzPhysics
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR_DECL;
|
||||
AZ_RTTI(StaticRigidBody, "{13A677BB-7085-4EDB-BCC8-306548238692}", SimulatedBody);
|
||||
AZ_RTTI(AzPhysics::StaticRigidBody, "{13A677BB-7085-4EDB-BCC8-306548238692}", AzPhysics::SimulatedBody);
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
//Legacy API - may change with LYN-438
|
||||
//! Add a shape to the static rigid body.
|
||||
//! @param shape A shared pointer of the shape to add.
|
||||
virtual void AddShape(const AZStd::shared_ptr<Physics::Shape>& shape) = 0;
|
||||
|
||||
//! Returns the number of shapes that make up this static rigid body.
|
||||
//! @return Returns the number of shapes as a AZ::u32.
|
||||
virtual AZ::u32 GetShapeCount() { return 0; }
|
||||
|
||||
//! Returns a shared pointer to the requested shape index.
|
||||
//! @param index The index of the shapes to return. Expected to be between 0 and GetShapeCount().
|
||||
//! @return Returns a shared pointer of the shape requested or nullptr if index is out of bounds.
|
||||
virtual AZStd::shared_ptr<Physics::Shape> GetShape([[maybe_unused]]AZ::u32 index) { return nullptr; }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common)
|
||||
|
||||
set(LY_TOUCHBENDING_LAYER_BIT 63 CACHE STRING "Use TouchBending as the collision layer. The TouchBending layer can be a number from 1 to 63 (Default=63).")
|
||||
|
||||
ly_add_target(
|
||||
NAME AzFramework STATIC
|
||||
NAMESPACE AZ
|
||||
@@ -37,14 +35,6 @@ ly_add_target(
|
||||
3rdParty::lz4
|
||||
)
|
||||
|
||||
ly_add_source_properties(
|
||||
SOURCES
|
||||
AzFramework/Physics/Collision/CollisionGroups.cpp
|
||||
AzFramework/Physics/Collision/CollisionLayers.cpp
|
||||
PROPERTY COMPILE_DEFINITIONS
|
||||
VALUES TOUCHBENDING_LAYER_BIT=${LY_TOUCHBENDING_LAYER_BIT}
|
||||
)
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
@@ -226,13 +226,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
OUTPUT_SUBDIRECTORY
|
||||
Test.Assets/Gems/PhysX/Code/Tests
|
||||
)
|
||||
endif()
|
||||
|
||||
ly_add_source_properties(
|
||||
SOURCES
|
||||
Editor/CollisionLayersWidget.cpp
|
||||
Source/Collision.cpp
|
||||
Source/Configuration/PhysXConfiguration.cpp
|
||||
PROPERTY COMPILE_DEFINITIONS
|
||||
VALUES TOUCHBENDING_LAYER_BIT=${LY_TOUCHBENDING_LAYER_BIT}
|
||||
)
|
||||
endif()
|
||||
@@ -22,9 +22,6 @@ namespace PhysX
|
||||
namespace Editor
|
||||
{
|
||||
const AZStd::string CollisionLayersWidget::s_defaultCollisionLayerName = "Default";
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
const AZStd::string CollisionLayersWidget::s_touchBendCollisionLayerName = "TouchBend";
|
||||
#endif
|
||||
|
||||
CollisionLayersWidget::CollisionLayersWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@@ -150,12 +147,6 @@ namespace PhysX
|
||||
{
|
||||
lineEditCtrl->setEnabled(false);
|
||||
}
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
else if (lineEditCtrl->value() == s_touchBendCollisionLayerName)
|
||||
{
|
||||
lineEditCtrl->setEnabled(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,6 @@ namespace PhysX
|
||||
|
||||
static const AZ::u32 s_maxCollisionLayerNameLength = 32;
|
||||
static const AZStd::string s_defaultCollisionLayerName;
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
static const AZStd::string s_touchBendCollisionLayerName;
|
||||
#endif
|
||||
|
||||
explicit CollisionLayersWidget(QWidget* parent = nullptr);
|
||||
|
||||
|
||||
@@ -38,21 +38,6 @@ namespace PhysX
|
||||
return physx::PxFilterFlag::eDEFAULT;
|
||||
}
|
||||
|
||||
//Enable/Disable this macro in the TouchBending Gem wscript
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
//If any of the actors is in the TouchBend layer then we are not interested
|
||||
//in contact data, nor interested in eNOTIFY_* callbacks.
|
||||
const AZ::u64 touchBendLayerMask = AzPhysics::CollisionLayer::TouchBend.GetMask();
|
||||
const AZ::u64 layer0 = Combine(filterData0.word0, filterData0.word1);
|
||||
const AZ::u64 layer1 = Combine(filterData1.word0, filterData1.word1);
|
||||
if (layer0 == touchBendLayerMask || layer1 == touchBendLayerMask)
|
||||
{
|
||||
pairFlags = physx::PxPairFlag::eSOLVE_CONTACT |
|
||||
physx::PxPairFlag::eDETECT_DISCRETE_CONTACT;
|
||||
return physx::PxFilterFlag::eDEFAULT;
|
||||
}
|
||||
#endif //TOUCHBENDING_LAYER_BIT
|
||||
|
||||
// generate contacts for all that were not filtered above
|
||||
pairFlags =
|
||||
physx::PxPairFlag::eCONTACT_DEFAULT |
|
||||
@@ -89,22 +74,6 @@ namespace PhysX
|
||||
return physx::PxFilterFlag::eDEFAULT;
|
||||
}
|
||||
|
||||
//Enable/Disable this macro in the TouchBending Gem wscript
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
//If any of the actors is in the TouchBend layer then we are not interested
|
||||
//in contact data, nor interested in eNOTIFY_* callbacks.
|
||||
const AZ::u64 layer0 = Combine(filterData0.word0, filterData0.word1);
|
||||
const AZ::u64 layer1 = Combine(filterData1.word0, filterData1.word1);
|
||||
const AZ::u64 touchBendLayerMask = AzPhysics::CollisionLayer::TouchBend.GetMask();
|
||||
if (layer0 == touchBendLayerMask || layer1 == touchBendLayerMask)
|
||||
{
|
||||
pairFlags = physx::PxPairFlag::eSOLVE_CONTACT |
|
||||
physx::PxPairFlag::eDETECT_DISCRETE_CONTACT |
|
||||
physx::PxPairFlag::eDETECT_CCD_CONTACT;
|
||||
return physx::PxFilterFlag::eDEFAULT;
|
||||
}
|
||||
#endif
|
||||
|
||||
// generate contacts for all that were not filtered above
|
||||
pairFlags =
|
||||
physx::PxPairFlag::eCONTACT_DEFAULT |
|
||||
|
||||
@@ -23,11 +23,6 @@ namespace PhysX
|
||||
configuration.m_collisionGroups.CreateGroup("All", AzPhysics::CollisionGroup::All, AzPhysics::CollisionGroups::Id(), true);
|
||||
configuration.m_collisionGroups.CreateGroup("None", AzPhysics::CollisionGroup::None, AzPhysics::CollisionGroups::Id::Create(), true);
|
||||
|
||||
#ifdef TOUCHBENDING_LAYER_BIT
|
||||
configuration.m_collisionLayers.SetName(AzPhysics::CollisionLayer::TouchBend, "TouchBend");
|
||||
configuration.m_collisionGroups.CreateGroup("All_NoTouchBend", AzPhysics::CollisionGroup::All_NoTouchBend, AzPhysics::CollisionGroups::Id::Create(), true);
|
||||
#endif
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
namespace PhysX
|
||||
{
|
||||
AZ_CLASS_ALLOCATOR_IMPL(PhysX::StaticRigidBody, AZ::SystemAllocator, 0);
|
||||
|
||||
StaticRigidBody::StaticRigidBody(const AzPhysics::StaticRigidBodyConfiguration& configuration)
|
||||
{
|
||||
CreatePhysXActor(configuration);
|
||||
@@ -40,7 +42,7 @@ namespace PhysX
|
||||
|
||||
// Invalidate user data so it sets m_pxStaticRigidBody->userData to nullptr.
|
||||
// It's appropriate to do this as m_pxStaticRigidBody is a shared pointer and
|
||||
// techniqucally it could survive m_actorUserData life's spam.
|
||||
// technically it could survive m_actorUserData life's span.
|
||||
m_actorUserData.Invalidate();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace PhysX
|
||||
: public AzPhysics::StaticRigidBody
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(StaticRigidBody, AZ::SystemAllocator, 0);
|
||||
AZ_RTTI(StaticRigidBody, "{06E960EF-E1F3-466F-B34F-800E32775092}", AzPhysics::StaticRigidBody);
|
||||
AZ_CLASS_ALLOCATOR_DECL;
|
||||
AZ_RTTI(PhysX::StaticRigidBody, "{06E960EF-E1F3-466F-B34F-800E32775092}", AzPhysics::StaticRigidBody);
|
||||
|
||||
StaticRigidBody() = default;
|
||||
StaticRigidBody(const AzPhysics::StaticRigidBodyConfiguration& configuration);
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace PhysX
|
||||
{
|
||||
protected:
|
||||
const AZStd::string DefaultLayer = "Default";
|
||||
const AZStd::string TouchBendLayer = "TouchBend";
|
||||
const AZStd::string LayerA = "LayerA";
|
||||
const AZStd::string LayerB = "LayerB";
|
||||
const AZStd::string GroupA = "GroupA";
|
||||
@@ -42,7 +41,6 @@ namespace PhysX
|
||||
AZStd::vector<AZStd::string> TestCollisionLayers =
|
||||
{
|
||||
DefaultLayer,
|
||||
TouchBendLayer, // This is needed here as placeholder as collision events are disabled on this layer.
|
||||
LayerA,
|
||||
LayerB
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user