-
-
Notifications
You must be signed in to change notification settings - Fork 222
update: add Ray/Hull Trace API (INavPhysicsInterface) #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SlynxCZ
wants to merge
3
commits into
roflmuffin:main
Choose a base branch
from
SlynxCZ:SlynxCZ/nav_physics_impl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
managed/CounterStrikeSharp.API/Modules/Utils/ContentsMask.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| /* | ||
| * This file is part of CounterStrikeSharp. | ||
| * CounterStrikeSharp is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * CounterStrikeSharp is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with CounterStrikeSharp. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| namespace CounterStrikeSharp.API.Modules.Utils; | ||
|
|
||
| /// <summary> | ||
| /// Contents flags for physics interaction layers (bspflags.h / const.h). | ||
| /// Used with <see cref="TraceOptions"/> and <see cref="Trace.PointContents"/>. | ||
| /// </summary> | ||
| public static class Contents | ||
| { | ||
| public const ulong Empty = 0ul; | ||
|
|
||
| public const ulong Solid = 1ul << 0; | ||
| public const ulong Hitbox = 1ul << 1; | ||
| public const ulong Trigger = 1ul << 2; | ||
| public const ulong Sky = 1ul << 3; | ||
|
|
||
| public const ulong PlayerClip = 1ul << 4; | ||
| public const ulong NpcClip = 1ul << 5; | ||
| public const ulong BlockLos = 1ul << 6; | ||
| public const ulong BlockLight = 1ul << 7; | ||
| public const ulong Ladder = 1ul << 8; | ||
| public const ulong Pickup = 1ul << 9; | ||
| public const ulong BlockSound = 1ul << 10; | ||
| public const ulong NoDraw = 1ul << 11; | ||
| public const ulong Window = 1ul << 12; | ||
| public const ulong PassBullets = 1ul << 13; | ||
| public const ulong WorldGeometry = 1ul << 14; | ||
| public const ulong Water = 1ul << 15; | ||
| public const ulong Slime = 1ul << 16; | ||
| public const ulong TouchAll = 1ul << 17; | ||
| public const ulong Player = 1ul << 18; | ||
| public const ulong Npc = 1ul << 19; | ||
| public const ulong Debris = 1ul << 20; | ||
| public const ulong PhysicsProp = 1ul << 21; | ||
| public const ulong NavIgnore = 1ul << 22; | ||
| public const ulong NavLocalIgnore = 1ul << 23; | ||
| public const ulong PostProcessingVolume = 1ul << 24; | ||
| public const ulong UnusedLayer3 = 1ul << 25; | ||
| public const ulong CarriedObject = 1ul << 26; | ||
| public const ulong Pushaway = 1ul << 27; | ||
| public const ulong ServerEntityOnClient = 1ul << 28; | ||
| public const ulong CarriedWeapon = 1ul << 29; | ||
| public const ulong StaticLevel = 1ul << 30; | ||
|
|
||
| public const ulong CsgoTeam1 = 1ul << 31; | ||
| public const ulong CsgoTeam2 = 1ul << 32; | ||
| public const ulong CsgoGrenadeClip = 1ul << 33; | ||
| public const ulong CsgoDroneClip = 1ul << 34; | ||
| public const ulong CsgoMoveable = 1ul << 35; | ||
| public const ulong CsgoOpaque = 1ul << 36; | ||
| public const ulong CsgoMonster = 1ul << 37; | ||
| public const ulong CsgoUnusedLayer = 1ul << 38; | ||
| public const ulong CsgoThrownGrenade = 1ul << 39; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Composite trace masks (bspflags.h MASK_* defines). | ||
| /// </summary> | ||
| public static class Mask | ||
| { | ||
| public const ulong All = ~0ul; | ||
|
|
||
| /// <summary>Everything that is normally solid.</summary> | ||
| public const ulong Solid = Contents.Solid | Contents.Window | Contents.Player | Contents.Npc | Contents.PassBullets; | ||
|
|
||
| /// <summary>Everything that blocks player movement.</summary> | ||
| public const ulong PlayerSolid = Contents.Solid | Contents.PlayerClip | Contents.Window | Contents.Player | Contents.Npc | Contents.PassBullets; | ||
|
|
||
| /// <summary>Blocks NPC movement.</summary> | ||
| public const ulong NpcSolid = Contents.Solid | Contents.NpcClip | Contents.Window | Contents.Player | Contents.Npc | Contents.PassBullets; | ||
|
|
||
| /// <summary>Blocks fluid movement.</summary> | ||
| public const ulong NpcFluid = Contents.Solid | Contents.NpcClip | Contents.Window | Contents.Player | Contents.Npc; | ||
|
|
||
| /// <summary>Water physics.</summary> | ||
| public const ulong Water = Contents.Water | Contents.Slime; | ||
|
|
||
| /// <summary>Bullets see these as solid.</summary> | ||
| public const ulong Shot = Contents.Solid | Contents.Player | Contents.Npc | Contents.Window | Contents.Debris | Contents.Hitbox; | ||
|
|
||
| /// <summary>Bullets see these as solid, except monsters (world + brush only).</summary> | ||
| public const ulong ShotBrushOnly = Contents.Solid | Contents.Window | Contents.Debris; | ||
|
|
||
| /// <summary>Non-raycasted weapons see this as solid (includes grates).</summary> | ||
| public const ulong ShotHull = Contents.Solid | Contents.Player | Contents.Npc | Contents.Window | Contents.Debris | Contents.PassBullets; | ||
|
|
||
| /// <summary>Hits solids (not grates) and passes through everything else.</summary> | ||
| public const ulong ShotPortal = Contents.Solid | Contents.Window | Contents.Player | Contents.Npc; | ||
|
|
||
| /// <summary>Everything normally solid, except monsters (world + brush only).</summary> | ||
| public const ulong SolidBrushOnly = Contents.Solid | Contents.Window | Contents.PassBullets; | ||
|
|
||
| /// <summary>Everything normally solid for player movement, except monsters (world + brush only).</summary> | ||
| public const ulong PlayerSolidBrushOnly = Contents.Solid | Contents.Window | Contents.PlayerClip | Contents.PassBullets; | ||
|
|
||
| /// <summary>Everything normally solid for NPC movement, except monsters (world + brush only).</summary> | ||
| public const ulong NpcSolidBrushOnly = Contents.Solid | Contents.Window | Contents.NpcClip | Contents.PassBullets; | ||
| } | ||
|
|
||
| public enum RayType_t : uint | ||
| { | ||
| RAY_TYPE_LINE = 0x0, | ||
| RAY_TYPE_SPHERE = 0x1, | ||
| RAY_TYPE_HULL = 0x2, | ||
| RAY_TYPE_CAPSULE = 0x3, | ||
| RAY_TYPE_MESH = 0x4 | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these do still exist in the yaml so next code gen would re add these, what was the point of this removal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like they've just been moved? I'm assuming the generator may have done this? If not they should probably be moved back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've regenerated whole API.cs using CodeGen, basically I removed everything and ran CodeGen to have up-to-date methods