@@ -152,6 +152,7 @@ void GameObjectsDisplay::on_frame() {
152
152
static auto get_gameobject_method = transform_def->get_method (" get_GameObject" );
153
153
static auto get_position_method = transform_def->get_method (" get_Position" );
154
154
static auto get_axisz_method = transform_def->get_method (" get_AxisZ" );
155
+ static auto get_world_matrix_method = transform_def->get_method (" get_WorldMatrix" );
155
156
156
157
auto math = sdk::get_native_singleton (" via.math" );
157
158
auto math_t = sdk::find_type_definition (" via.math" );
@@ -229,6 +230,8 @@ void GameObjectsDisplay::on_frame() {
229
230
});
230
231
}
231
232
233
+ __declspec (align (16 )) Matrix4x4f world_matrix{};
234
+
232
235
for (auto transform = first_transform;
233
236
transform != nullptr ;
234
237
transform = next_transform_method->call <RETransform*>(context, transform))
@@ -264,15 +267,7 @@ void GameObjectsDisplay::on_frame() {
264
267
}
265
268
266
269
if (is_d3d12) {
267
- // Billboard rotation to make the quad face the camera
268
- /* DirectX::SimpleMath::Matrix rotation = DirectX::SimpleMath::Matrix::CreateBillboard(
269
- DirectX::SimpleMath::Vector3(pos.x, pos.y, pos.z),
270
- DirectX::SimpleMath::Vector3(camera_origin.x, camera_origin.y, camera_origin.z),
271
- DirectX::SimpleMath::Vector3::Up
272
- );*/
273
-
274
- Matrix4x4f world_matrix{};
275
- sdk::call_object_func<void *>(transform, " get_WorldMatrix" , &world_matrix, context, transform);
270
+ get_world_matrix_method->call <void *>(&world_matrix, context, transform);
276
271
277
272
DirectX::SimpleMath::Matrix world =
278
273
DirectX::SimpleMath::Matrix{&world_matrix[0 ][0 ]};
0 commit comments