Implemented handling the new collider_z_offset property for merged TiledWalls.

This commit is contained in:
Relintai 2022-07-31 14:04:26 +02:00
parent 0227b18d06
commit 40d9d6b49b

View File

@ -607,6 +607,9 @@ void PropInstanceMerger::_prop_preprocess(Transform transform, const Ref<PropDat
Ref<PropDataTiledWall> tiled_wall_data = e;
if (tiled_wall_data.is_valid()) {
Ref<TiledWallData> twd = tiled_wall_data->get_data();
if (twd.is_valid()) {
_job->add_tiled_wall(tiled_wall_data, t);
if (tiled_wall_data->get_collision()) {
@ -618,12 +621,14 @@ void PropInstanceMerger::_prop_preprocess(Transform transform, const Ref<PropDat
tws->set_extents(Vector3(hew, heh, 0.01));
Transform tt = t;
Transform et = e->get_transform() * Transform(Basis(), Vector3(0, 0, twd->get_colldier_z_offset()));
Transform tt = transform * et;
//tt.origin += Vector3(hew, heh, 0);
tt.translate(hew, heh, 0);
_job->add_collision_shape(tws, tt, true);
}
}
continue;
}