(actor_list, ev_transform, get_acceleration = False, origin = False)
| 81 | return rotation_matrix |
| 82 | |
| 83 | def get_loc_rot_vel_in_ev(actor_list, ev_transform, get_acceleration = False, origin = False): |
| 84 | location, rotation, absolute_velocity = [], [], [] |
| 85 | if get_acceleration: |
| 86 | absolute_acceleration = [] |
| 87 | if origin: |
| 88 | origin_velocity = [] |
| 89 | origin_acceleration = [] |
| 90 | for actor in actor_list: |
| 91 | # location |
| 92 | location_in_world = actor.get_transform().location |
| 93 | location_in_ev = loc_global_to_ref(location_in_world, ev_transform) |
| 94 | location.append([location_in_ev.x, location_in_ev.y, location_in_ev.z]) |
| 95 | # rotation |
| 96 | rotation_in_world = actor.get_transform().rotation |
| 97 | rotation_in_ev = rot_global_to_ref(rotation_in_world, ev_transform.rotation) |
| 98 | rotation.append([rotation_in_ev.roll, rotation_in_ev.pitch, rotation_in_ev.yaw]) |
| 99 | # velocity |
| 100 | vel_in_world = actor.get_velocity() |
| 101 | vel_in_ev = vec_global_to_ref(vel_in_world, ev_transform.rotation) |
| 102 | absolute_velocity.append([vel_in_ev.x, vel_in_ev.y, vel_in_ev.z]) |
| 103 | if get_acceleration: |
| 104 | # acceleration |
| 105 | acc_in_world = actor.get_acceleration() |
| 106 | acc_in_ev = vec_global_to_ref(acc_in_world, ev_transform.rotation) |
| 107 | absolute_acceleration.append([acc_in_ev.x, acc_in_ev.y, acc_in_ev.z]) |
| 108 | if origin: |
| 109 | origin_velocity.append([vel_in_world.x, vel_in_world.y, vel_in_world.z]) |
| 110 | origin_acceleration.append([acc_in_world.x, acc_in_world.y, acc_in_world.z]) |
| 111 | if get_acceleration: |
| 112 | if origin: |
| 113 | return location, rotation, absolute_velocity, absolute_acceleration, origin_velocity, origin_acceleration |
| 114 | return location, rotation, absolute_velocity, absolute_acceleration |
| 115 | return np.array(location), np.array(rotation), np.array(absolute_velocity) |
| 116 | |
| 117 | def get_loc_rot_in_global(actor_list): |
| 118 | location, rotation = [], [] |
nothing calls this directly
no test coverage detected