Overhaul physics test organization (#3684)

* Moved files

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Fixes for moved files

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

* Removed tmp file

Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>

Co-authored-by: Garcia Ruiz <aljanru@amazon.co.uk>
This commit is contained in:
AMZN-AlexOteiza
2021-08-31 10:04:24 +01:00
committed by GitHub
parent d784ff8c57
commit 77e630085b
161 changed files with 316 additions and 1333 deletions
@@ -0,0 +1,32 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.components
import azlmbr.physics
class Box:
def __init__(self, name):
self.name = name
self.distances = []
def find(self):
self.id = general.find_game_entity(self.name)
self.start_position = self.position
return self.id.IsValid()
@property
def position(self):
return azlmbr.components.TransformBus(bus.Event, "GetWorldTranslation", self.id)
def is_stationary(self):
velocity = azlmbr.physics.RigidBodyRequestBus(bus.Event, "GetLinearVelocity", self.id)
return velocity.IsZero()
def push(self, impulse):
azlmbr.physics.RigidBodyRequestBus(bus.Event, "ApplyLinearImpulse", self.id, impulse)