Skip to content

Commit

Permalink
Fix intersection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DaikonNimono committed Mar 15, 2024
1 parent 0d6592a commit a907530
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 37 deletions.
3 changes: 2 additions & 1 deletion data/FirstPersonShooter.world
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,7 @@
<parameter name="shootInput">036d975119765037c8ffff946a805cb6d3ccf640</parameter>
<parameter name="weaponMuzzle">1277251179</parameter>
<parameter name="vfx">89f9e2eb8cec4e8579167ee622b67d8f601db972</parameter>
<parameter name="mask">0x1</parameter>
</property>
<property parent="19c5bafbe8a7932cdd4890d4a298a355b4d1dec7" guid="89f9e2eb8cec4e8579167ee622b67d8f601db972">
<parameter name="hitPrefab">guid://8c628a2a1e96b3815d3476ec7c87055be14f7afe</parameter>
Expand Down Expand Up @@ -2553,7 +2554,7 @@
<streaming_mode_vram>0</streaming_mode_vram>
<streaming_mode_ram>0</streaming_mode_ram>
<mesh_name>guid://89640b0d7ffa9f7f02a1a97753abc138ef6e3f24</mesh_name>
<surface name="box" intersection="1" shadow_mask="0x0" viewport_mask="0x0" material="37b5258e98b7907a6fdfa8cc5256713c8ffef517"/>
<surface name="box" intersection="1" shadow_mask="0x0" viewport_mask="0x0" intersection_mask="0x2" material="37b5258e98b7907a6fdfa8cc5256713c8ffef517"/>
<transform>1 -7.1054274e-15 2.9611872e-16 0.0 7.1054274e-15 1 2.4335929e-08 0.0 -2.9611893e-16 -2.4335929e-08 1 0.0 5.5368699e-21 3.765877e-14 0 1.0</transform>
</node>
</node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void UpdateRoute()
if (shouldUpdateRoute)
{
// рассчитываем путь до игрока
route.Create2D(node.WorldPosition, lastSeenPosition, 1);
route.Create2D(node.WorldPosition + vec3.UP * 0.5f, lastSeenPosition, 1);
shouldUpdateRoute = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<asset version="2.18.0.1">
<guid>5158593f996ef01aae4f3a2a8ce7a21d539470f6</guid>
<type>component</type>
<hash>bc5e00f5</hash>
<hash>a3aaceda</hash>
<runtimes>
<runtime id="5158593f996ef01aae4f3a2a8ce7a21d539470f6" name="EnemyLogic.cs" link="0"/>
<runtime id="5efec285bbcacbfd75d58238dff8fedd1ee54024" name="EnemyLogic.prop" link="1" type="4"/>
Expand Down
8 changes: 5 additions & 3 deletions data/csharp_template/props/constructor/glass.node
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<nodes version="2.18.0.1">
<node type="ObjectMeshStatic" id="722101530" immovable="1" name="glass">
<node type="ObjectMeshStatic" id="864446535" immovable="1" name="glass">
<streaming_mode_vram>0</streaming_mode_vram>
<streaming_mode_ram>0</streaming_mode_ram>
<mesh_name>guid://6e10090b18eccaeeaa8e15759a9fa850236a5f6f</mesh_name>
<surface name="floor_0_mat" cast_shadow="0" cast_world_shadow="0" cast_env_probe_shadow="0" physics_friction="1" physics_restitution="1" material="95d5a1fcc86e952b0aaea88ed4541695ba4076f0" intersection="1"/>
<transform>0.9999997 -1.1368683e-13 -3.8213786e-15 0.0 0 0.99999976 8.7422222e-08 0.0 3.821365e-15 -8.7422734e-08 0.99999964 0.0 0 -3.7959126e-08 0 1.0</transform>
<surface name="floor_0_mat" cast_shadow="0" cast_world_shadow="0" cast_env_probe_shadow="0" intersection="1" intersection_mask="0x3" physics_friction="1" physics_restitution="1" material="95d5a1fcc86e952b0aaea88ed4541695ba4076f0"/>
<transform>0.99999958 -1.1368681e-13 -3.8213786e-15 0.0 1.6940659e-21 0.99999958 8.7422109e-08 0.0 3.8213637e-15 -8.7422791e-08 0.99999952 0.0 5.2106638e-14 0 4.4711669e-08 1.0</transform>
</node>
</nodes>
7 changes: 7 additions & 0 deletions data/default.bitmasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<bit_mask_names>
<intersection>
<name index="0">Trace</name>
<name index="1">PlayerHit</name>
</intersection>
</bit_mask_names>
9 changes: 9 additions & 0 deletions data/default.bitmasks.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<asset version="2.18.0.1">
<guid>7ae7286bf9e7d49f149b3572bb1ffc03c8aa521b</guid>
<type>file</type>
<hash>1ded9d65</hash>
<runtimes>
<runtime id="7ae7286bf9e7d49f149b3572bb1ffc03c8aa521b" name="default.bitmasks" link="0"/>
</runtimes>
</asset>
10 changes: 5 additions & 5 deletions data/fps/bullet/bullet.node
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<nodes version="2.18.0.1">
<node type="ObjectMeshStatic" id="52787996" name="bullet">
<node type="ObjectMeshStatic" id="57845890" name="bullet">
<streaming_mode_vram>0</streaming_mode_vram>
<streaming_mode_ram>0</streaming_mode_ram>
<mesh_name>guid://0527657119e3201c2e7ebccb87ea6bae0e3bbf35</mesh_name>
<surface name="bullet_mat" physics_friction="1" physics_restitution="1" material="55268c62a0e52059dba60de4e8aa7ff37acd44b6"/>
<properties>
<property parent="d798d617fcbdfc8a6e2dc2610bad784cb198573b" guid="d92c6a312c31642aef97ccf4f098c497f1c569a0">
<property parent="d798d617fcbdfc8a6e2dc2610bad784cb198573b" guid="943c6b1b13270461c6ae44b5659fdb4af970eeed">
<parameter name="lifeTime">5</parameter>
</property>
<property parent="88d6112b0032ace8365867c48dbe1958c29471f7" guid="4a99812f1556312f6929ed5acf83feefd29e5b26">
<property parent="88d6112b0032ace8365867c48dbe1958c29471f7" guid="117860200fce17d959dfc20e201acfc53b828368">
<parameter name="hitPrefab">guid://8c628a2a1e96b3815d3476ec7c87055be14f7afe</parameter>
</property>
</properties>
<transform>1 2.208811e-29 2.1175814e-21 0.0 -2.2087505e-29 0.99999988 -2.8421701e-13 0.0 -2.1175814e-21 2.8421704e-13 1 0.0 1.9073486e-06 -2.8610229e-06 0.73676425 1.0</transform>
<node type="LightOmni" id="1512004555" name="bullet_light">
<node type="LightOmni" id="219631097" name="bullet_light">
<attenuation_distance>2</attenuation_distance>
<shape>2 1 0.200000003</shape>
<shape_type>0</shape_type>
Expand Down Expand Up @@ -89,7 +89,7 @@
<billboard name="flare_30" offset="1" size="1.03999996" rotate="0" uv_lower_left="0.75 0.75" uv_upper_right="1 1" color="0.972549081 1 0.898039281 1" offset_scale="1" intensity="0.150000006"/>
</lens_flare_billboards>
<properties>
<property parent="d798d617fcbdfc8a6e2dc2610bad784cb198573b" guid="1dc79c333432e50787697aec52554dc17c2b107f"/>
<property parent="d798d617fcbdfc8a6e2dc2610bad784cb198573b" guid="df2797c5d01379f333e046efa382a98b17930fa7"/>
</properties>
<transform>1 -2.2087513e-29 -2.1175824e-21 0.0 2.2088104e-29 1.0000005 2.8421728e-13 0.0 2.1175818e-21 -2.8421734e-13 1.0000002 0.0 0 0.11498165 1.9639169e-12 1.0</transform>
</node>
Expand Down
53 changes: 27 additions & 26 deletions data/fps/robot/robot_enemy.node
Original file line number Diff line number Diff line change
@@ -1,86 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<nodes version="2.18.0.1">
<node type="ObjectDummy" id="1441214508" name="robot_root">
<body type="BodyRigid" id="1239531732" frozen="0">
<node type="ObjectDummy" id="19500806" name="robot_root">
<body type="BodyRigid" id="1982313634" frozen="0">
<angular_scale>0 0 0</angular_scale>
<shape type="ShapeCapsule" id="828655026" transform="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.850000024 1">
<shape type="ShapeCapsule" id="967673276" transform="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.850000024 1">
<radius>0.5</radius>
<height>0.699999988</height>
</shape>
</body>
<properties>
<property parent="7eb5cbfb6c98181a790c65d41fb95f354d95dfc7" guid="71be60c5352d73e32ce75b78e50b33ea5c69ed64">
<parameter name="leftMuzzle">1481376270</parameter>
<parameter name="rightMuzzle">390761584</parameter>
<property parent="7eb5cbfb6c98181a790c65d41fb95f354d95dfc7" guid="d01a6afd17bbe07670f96592bcf7e07b219901b2">
<parameter name="leftMuzzle">594287224</parameter>
<parameter name="rightMuzzle">359711338</parameter>
<parameter name="bulletPrefab">guid://ec33ae15d2782870bf95a10f4fab1b221b40e019</parameter>
</property>
<property parent="5efec285bbcacbfd75d58238dff8fedd1ee54024" guid="7f4b256739316db736893ef0bbae2f115129d973">
<property parent="5efec285bbcacbfd75d58238dff8fedd1ee54024" guid="029bd1f973305c170860d2c8f400cb3b1242f569">
<parameter name="player">131174606</parameter>
<parameter name="intersectionSocket">981409570</parameter>
<parameter name="playerIntersectionMask">0xffffffff</parameter>
<parameter name="intersectionSocket">30316844</parameter>
<parameter name="playerIntersectionMask">0x2</parameter>
<parameter name="navigationMesh">1177965118</parameter>
</property>
</properties>
<transform>1 0 0 0.0 0 1 0 0.0 0 0 1 0.0 0 0 0 1.0</transform>
<node type="ObjectMeshSkinned" id="1789521307" name="visuals">
<node type="ObjectMeshSkinned" id="1377671853" name="visuals">
<mesh_name>guid://113ec57667d1fe5d0486ec1847b280978e7aa50a</mesh_name>
<fps_visible_camera>-1</fps_visible_camera>
<fps_visible_shadow>30</fps_visible_shadow>
<fps_invisible>0</fps_invisible>
<anim_name>guid://746550e169c6b4cc6f7b69bb6516d3de27b029a5</anim_name>
<loop>1</loop>
<speed>30</speed>
<surface name="robot_glass_color" intersection="1" physics_friction="1" physics_restitution="1" material="1ee39dfdeca5c738c2b26137b098cd2a1f0a1a81"/>
<surface name="robot_glass_reflections_mat" intersection="1" physics_friction="1" physics_restitution="1" material="e2b3d14bd547762e14a447b5be05b590e4208baf"/>
<surface name="robot_mat" intersection="1" physics_friction="1" physics_restitution="1" material="bc7eb378d117e07749b3c36aafc61bc1ce66422c"/>
<surface name="robot_glass_color" intersection="1" intersection_mask="0x3" physics_friction="1" physics_restitution="1" material="1ee39dfdeca5c738c2b26137b098cd2a1f0a1a81"/>
<surface name="robot_glass_reflections_mat" intersection="1" intersection_mask="0x3" physics_friction="1" physics_restitution="1" material="e2b3d14bd547762e14a447b5be05b590e4208baf"/>
<surface name="robot_mat" intersection="1" intersection_mask="0x3" physics_friction="1" physics_restitution="1" material="bc7eb378d117e07749b3c36aafc61bc1ce66422c"/>
<transform>0.49999994 -3.7865182e-29 4.2351652e-22 0.0 3.7865191e-29 0.5 -3.5527162e-15 0.0 -4.2351657e-22 3.5527162e-15 0.5 0.0 0 0 0 1.0</transform>
<node type="WorldTransformBone" id="266257982" name="WorldTransformBone">
<node type="WorldTransformBone" id="1316338728" name="WorldTransformBone">
<bone>joint_2</bone>
<transform>0.71341574 -0.69943857 0.042703133 0.0 0.55578786 0.60190356 0.57342124 0.0 -0.42677617 -0.38535389 0.818147 0.0 0.27450061 0.27222845 0.76832491 1.0</transform>
<node type="NodeReference" id="701085829" name="jet_3">
<node type="NodeReference" id="21590375" name="jet_3">
<reference>guid://0a134f9336798fd67bd0853d9e11057894320a77</reference>
<transform>2.0000455 4.5448542e-07 7.7486038e-07 0.0 -2.2940338e-05 2.0000837 4.7683716e-07 0.0 1.5363097e-05 1.3530254e-05 2.0000713 0.0 -1.9073486e-06 -1.6391277e-06 -0.23828951 1.0</transform>
</node>
</node>
<node type="WorldTransformBone" id="240619090" name="WorldTransformBone_1">
<node type="WorldTransformBone" id="794361308" name="WorldTransformBone_1">
<bone>joint_3</bone>
<transform>-0.69019872 -0.71501589 -0.11125735 0.0 0.64177847 -0.67588562 0.36235246 0.0 -0.33428502 0.17869264 0.92537683 0.0 0.27457523 -0.2628285 0.76287109 1.0</transform>
<node type="NodeReference" id="1066916233" name="jet_2">
<node type="NodeReference" id="1670741899" name="jet_2">
<reference>guid://0a134f9336798fd67bd0853d9e11057894320a77</reference>
<transform>2.0000529 7.1525574e-07 -2.8312206e-07 0.0 2.5868416e-05 2.0000694 0 0.0 -6.1839819e-06 5.0067902e-06 2.0000868 0.0 8.3446503e-07 -7.1525574e-07 -0.24650681 1.0</transform>
</node>
</node>
<node type="WorldTransformBone" id="1925115302" name="WorldTransformBone_2">
<node type="WorldTransformBone" id="40804560" name="WorldTransformBone_2">
<bone>joint_4</bone>
<transform>-0.66923231 0.73246187 -0.12501162 0.0 -0.695288 -0.55793941 0.45307654 0.0 0.26211244 0.39013252 0.88266277 0.0 -0.25062135 -0.26249185 0.72265375 1.0</transform>
<node type="NodeReference" id="1476864205" name="jet_1">
<node type="NodeReference" id="611319279" name="jet_1">
<reference>guid://0a134f9336798fd67bd0853d9e11057894320a77</reference>
<transform>2.0000427 -6.92904e-07 2.9802322e-07 0.0 -2.2009015e-05 2.0000668 -2.3841858e-07 0.0 1.4021993e-05 1.5318394e-05 2.0000677 0.0 -1.3113022e-06 -2.0861626e-06 -0.23225865 1.0</transform>
</node>
</node>
<node type="WorldTransformBone" id="453294138" name="WorldTransformBone_3">
<node type="WorldTransformBone" id="823007492" name="WorldTransformBone_3">
<bone>joint_5</bone>
<transform>0.73238534 0.6773814 0.069038153 0.0 -0.6677205 0.69467193 0.26754504 0.0 0.13327116 -0.24204428 0.96106887 0.0 -0.250696 0.2725651 0.72810757 1.0</transform>
<node type="NodeReference" id="2059233873" name="jet">
<node type="NodeReference" id="1233244307" name="jet">
<reference>guid://0a134f9336798fd67bd0853d9e11057894320a77</reference>
<transform>2.0000515 -1.0430813e-07 4.4703484e-08 0.0 2.669543e-05 2.000087 0 0.0 -7.0631504e-06 6.0796738e-06 2.0000861 0.0 1.0430813e-06 -9.5367432e-07 -0.2365478 1.0</transform>
</node>
</node>
<node type="WorldTransformBone" id="1481376270" name="LeftGunBone">
<node type="WorldTransformBone" id="594287224" name="LeftGunBone">
<bone>joint_8</bone>
<transform>0.99988168 -1.7359685e-05 0.015381269 0.0 -0.00013943078 0.99994802 0.010192467 0.0 -0.015380647 -0.010193406 0.99982971 0.0 -0.63721955 0.39293978 1.4175342 1.0</transform>
<node type="NodeDummy" id="880452117" name="LeftGunMuzzle">
<node type="NodeDummy" id="825236343" name="LeftGunMuzzle">
<transform>0.99999994 0 0 0.0 0 0.99999994 0 0.0 0 0 0.99999988 0.0 0 0.80000001 -1.1920929e-07 1.0</transform>
</node>
</node>
<node type="WorldTransformBone" id="390761584" name="RightGunBone">
<node type="WorldTransformBone" id="359711338" name="RightGunBone">
<bone>joint_11</bone>
<transform>0.99988168 -1.7359685e-05 0.015381269 0.0 -0.00013943078 0.99994802 0.010192467 0.0 -0.015380647 -0.010193406 0.99982971 0.0 0.62459785 0.39291796 1.4369448 1.0</transform>
<node type="NodeDummy" id="1444721935" name="RightGunMuzzle">
<node type="NodeDummy" id="1022955201" name="RightGunMuzzle">
<transform>1 1.4551915e-11 0 0.0 0 1 -9.3132257e-10 0.0 9.3132257e-10 0 0.99999994 0.0 0 0.80000001 0 1.0</transform>
</node>
</node>
</node>
<node type="NodeDummy" id="981409570" name="robot_intersection_socket">
<node type="NodeDummy" id="30316844" name="robot_intersection_socket">
<transform>1 0 0 0.0 0 1 0 0.0 0 0 1 0.0 0 0 0.90023208 1.0</transform>
</node>
</node>
Expand Down
2 changes: 2 additions & 0 deletions data/guids.db
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
"f3ec078f3b4f18aab54af5b819464b7260a2c11b": "csharp_template/FP_controller/components/Bullet.cs.meta",
"720f8709336da3c5346e8e1a4a1710b611222eb5": "csharp_template/FP_controller/components/ShootInput.cs.meta",
"373e54478e60df440dd556c14a217d4a0dab2a36": "fps/particles/textures/normal.dds.meta",
"422cf595cbe8a7e975ca1bf4278201d8582a1105": "default.bitmasks.meta",
"606e65e9f22fcdbe867c20631e72229baa3c44ae": "configs/default.controls.meta",
"4e7c41aea7b42e2f8860ed7c47e7cb76665ae3cd": "core/materials/base/debug/debug_f0.mat.meta",
"d1e76aeb2bf449331dd7723561ca654e15b897d8": "core/materials/base/objects/clouds/presets/clouds_cumulonimbus1.mat.meta",
Expand Down Expand Up @@ -2060,6 +2061,7 @@
"27288c553eaee1ae73cc529616f559e6334c2941": "csharp_template/FP_controller/components/Bullet.cs",
"37c301bff495e86069da00a84295485df343e04b": "csharp_template/FP_controller/components/ShootInput.cs",
"6fbaf9250d79793e257226fcbca7afaeb81f7c26": "fps/particles/textures/normal.dds",
"7ae7286bf9e7d49f149b3572bb1ffc03c8aa521b": "default.bitmasks",
"14cf5f169cc59cb3e00722a41fee17ee6a0dcc15": "configs/default.controls",
"85ddba584016b8e6ae75d7966a0b77e18e3804af": "core/systems/tracker/parameters/sound.parameters",
"4d97ef4aed349542f37602b88678f3f50b4224b9": "core/systems/tracker/parameters/node.parameters",
Expand Down

0 comments on commit a907530

Please sign in to comment.