|
1 | 1 | #include "stdafx.h" |
2 | 2 |
|
3 | | -#include "actorcameracollision.h" |
| 3 | +#include "ActorCameraCollision.h" |
4 | 4 |
|
5 | 5 | #include "xrEngine/CameraBase.h" |
6 | 6 | #include "xrEngine/GameMtlLib.h" |
7 | 7 |
|
8 | | -#include "phworld.h" |
9 | | -#include "phcollidevalidator.h" |
| 8 | +#include "PHWorld.h" |
| 9 | +#include "PHCollideValidator.h" |
10 | 10 | #include "PHShell.h" |
11 | 11 | #include "matrix_utils.h" |
12 | | -#include "iphysicsshellholder.h" |
13 | | - |
| 12 | +#include "IPhysicsShellHolder.h" |
| 13 | +#include "xrEngine/xr_object.h" //--#SM+#-- |
14 | 14 | #include "GeometryBits.h" |
15 | 15 |
|
16 | 16 | #ifdef DEBUG |
@@ -43,6 +43,9 @@ static void cammera_shell_collide_callback_common( |
43 | 43 | VERIFY(my_data); |
44 | 44 | if (oposite_data && oposite_data->ph_ref_object == my_data->ph_ref_object) |
45 | 45 | return; |
| 46 | + if (oposite_data && oposite_data->ph_ref_object && |
| 47 | + !oposite_data->ph_ref_object->IsCollideWithActorCamera()) //--#SM+#-- |
| 48 | + return; |
46 | 49 | if (c.geom.depth > camera_collision_sckin_depth / 2.f) |
47 | 50 | cam_collided = true; |
48 | 51 |
|
@@ -316,6 +319,19 @@ bool test_camera_box(const Fvector& box_size, const Fmatrix& xform, IPhysicsShel |
316 | 319 | return ret; |
317 | 320 | } |
318 | 321 |
|
| 322 | +// Test only, generate box from camera --#SM+#-- |
| 323 | +bool test_camera_collide( |
| 324 | + CCameraBase& camera, float _viewport_near, IPhysicsShellHolder* l_actor, Fvector& vPosOffset, float fBoxSizeMod) |
| 325 | +{ |
| 326 | + Fvector box_size; |
| 327 | + Fmatrix xform; |
| 328 | + get_camera_box(box_size, xform, camera, _viewport_near); |
| 329 | + box_size.mul(fBoxSizeMod); |
| 330 | + xform.c.mad(camera.Direction(), vPosOffset); |
| 331 | + |
| 332 | + return test_camera_box(box_size, xform, l_actor); |
| 333 | +} |
| 334 | + |
319 | 335 | void collide_camera(CCameraBase& camera, float _viewport_near, IPhysicsShellHolder* l_actor) |
320 | 336 | { |
321 | 337 | // CPhysicsShellHolder* l_actor = smart_cast<CPhysicsShellHolder*>( Level().CurrentEntity() ); |
|
0 commit comments