|
@@ -45,10 +45,10 @@ def PhysX_Primitive_Collider_Component_CRUD():
|
|
|
REST_OFFSET_TESTS, CYLINDER_SUBDIVISION_TESTS)
|
|
|
|
|
|
from consts.general import Strings
|
|
|
+ from consts.physics import PHYSX_PRIMITIVE_COLLIDER
|
|
|
|
|
|
# 0) Pre-conditions
|
|
|
physx_material = os.path.join("physx", "glass.physxmaterial")
|
|
|
- component_name = "PhysX Primitive Collider"
|
|
|
|
|
|
TestHelper.init_idle()
|
|
|
TestHelper.open_level("", "Base")
|
|
@@ -63,41 +63,41 @@ def PhysX_Primitive_Collider_Component_CRUD():
|
|
|
# 3) Set Box Shape and Child Properties
|
|
|
physx_collider.set_box_shape()
|
|
|
|
|
|
- validate_vector3_property("Box Dimensions", physx_collider.get_box_dimensions, physx_collider.set_box_dimensions, component_name, VECTOR3_TESTS_NEGATIVE_EXPECT_PASS)
|
|
|
+ validate_vector3_property("Box Dimensions", physx_collider.get_box_dimensions, physx_collider.set_box_dimensions, PHYSX_PRIMITIVE_COLLIDER, VECTOR3_TESTS_NEGATIVE_EXPECT_PASS)
|
|
|
|
|
|
# 4) Set Capsule Shape and Child Properties
|
|
|
physx_collider.set_capsule_shape()
|
|
|
|
|
|
- validate_float_property("Capsule Height", physx_collider.get_capsule_height, physx_collider.set_capsule_height, component_name, FLOAT_HEIGHT_TESTS)
|
|
|
+ validate_float_property("Capsule Height", physx_collider.get_capsule_height, physx_collider.set_capsule_height, PHYSX_PRIMITIVE_COLLIDER, FLOAT_HEIGHT_TESTS)
|
|
|
validate_float_property("Capsule Radius", physx_collider.get_capsule_radius, physx_collider.set_capsule_radius, physx_collider.component.get_component_name(), COLLIDER_RADIUS_TESTS)
|
|
|
|
|
|
# 5) Set Cylinder Shape and Child Properties
|
|
|
physx_collider.set_cylinder_shape()
|
|
|
|
|
|
- validate_float_property("Cylinder Height", physx_collider.get_cylinder_height, physx_collider.set_cylinder_height, component_name, CYLINDER_HEIGHT_TESTS)
|
|
|
- validate_float_property("Cylinder Radius", physx_collider.get_cylinder_radius, physx_collider.set_cylinder_radius, component_name, COLLIDER_RADIUS_TESTS)
|
|
|
+ validate_float_property("Cylinder Height", physx_collider.get_cylinder_height, physx_collider.set_cylinder_height, PHYSX_PRIMITIVE_COLLIDER, CYLINDER_HEIGHT_TESTS)
|
|
|
+ validate_float_property("Cylinder Radius", physx_collider.get_cylinder_radius, physx_collider.set_cylinder_radius, PHYSX_PRIMITIVE_COLLIDER, COLLIDER_RADIUS_TESTS)
|
|
|
|
|
|
- validate_integer_property("Cylinder Subdivision", physx_collider.get_cylinder_subdivision, physx_collider.set_cylinder_subdivision, component_name, CYLINDER_SUBDIVISION_TESTS)
|
|
|
+ validate_integer_property("Cylinder Subdivision", physx_collider.get_cylinder_subdivision, physx_collider.set_cylinder_subdivision, PHYSX_PRIMITIVE_COLLIDER, CYLINDER_SUBDIVISION_TESTS)
|
|
|
|
|
|
# 6) Set Sphere Shape and Child Properties
|
|
|
physx_collider.set_sphere_shape()
|
|
|
|
|
|
- validate_float_property("Sphere Radius", physx_collider.get_sphere_radius, physx_collider.set_sphere_radius, component_name, COLLIDER_RADIUS_TESTS)
|
|
|
+ validate_float_property("Sphere Radius", physx_collider.get_sphere_radius, physx_collider.set_sphere_radius, PHYSX_PRIMITIVE_COLLIDER, COLLIDER_RADIUS_TESTS)
|
|
|
|
|
|
# 7) Set General Properties
|
|
|
- validate_property_switch_toggle("Is Trigger", physx_collider.get_is_trigger, physx_collider.set_is_trigger, component_name)
|
|
|
- validate_property_switch_toggle("Is Simulated", physx_collider.get_is_simulated, physx_collider.set_is_simulated, component_name)
|
|
|
- validate_property_switch_toggle("In Scene Queries", physx_collider.get_in_scene_queries, physx_collider.set_in_scene_queries, component_name)
|
|
|
+ validate_property_switch_toggle("Is Trigger", physx_collider.get_is_trigger, physx_collider.set_is_trigger, PHYSX_PRIMITIVE_COLLIDER)
|
|
|
+ validate_property_switch_toggle("Is Simulated", physx_collider.get_is_simulated, physx_collider.set_is_simulated, PHYSX_PRIMITIVE_COLLIDER)
|
|
|
+ validate_property_switch_toggle("In Scene Queries", physx_collider.get_in_scene_queries, physx_collider.set_in_scene_queries, PHYSX_PRIMITIVE_COLLIDER)
|
|
|
|
|
|
- validate_vector3_property("Offset", physx_collider.get_offset, physx_collider.set_offset, component_name, VECTOR3_TESTS_NEGATIVE_EXPECT_PASS)
|
|
|
+ validate_vector3_property("Offset", physx_collider.get_offset, physx_collider.set_offset, PHYSX_PRIMITIVE_COLLIDER, VECTOR3_TESTS_NEGATIVE_EXPECT_PASS)
|
|
|
|
|
|
# o3de/o3de#13223 - Add Quaternion Property Validator to validate Rotation property
|
|
|
# o3de/o3de#12634 - Get PhysX Primitive Collider Tag to set properly.
|
|
|
|
|
|
- validate_float_property("Contact Offset", physx_collider.get_contact_offset, physx_collider.set_contact_offset, component_name, CONTACT_OFFSET_TESTS)
|
|
|
- validate_float_property("Rest Offset", physx_collider.get_rest_offset, physx_collider.set_rest_offset, component_name, REST_OFFSET_TESTS)
|
|
|
+ validate_float_property("Contact Offset", physx_collider.get_contact_offset, physx_collider.set_contact_offset, PHYSX_PRIMITIVE_COLLIDER, CONTACT_OFFSET_TESTS)
|
|
|
+ validate_float_property("Rest Offset", physx_collider.get_rest_offset, physx_collider.set_rest_offset, PHYSX_PRIMITIVE_COLLIDER, REST_OFFSET_TESTS)
|
|
|
|
|
|
- validate_property_switch_toggle("Draw Collider", physx_collider.get_draw_collider, physx_collider.set_draw_collider, component_name)
|
|
|
+ validate_property_switch_toggle("Draw Collider", physx_collider.get_draw_collider, physx_collider.set_draw_collider, PHYSX_PRIMITIVE_COLLIDER)
|
|
|
|
|
|
# o3de/o3de#12503 PhysX Primitive Collider Component's Physic Material field(s) return unintuitive property tree paths.
|
|
|
|