-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat: C# scripting improvements #10
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
890e28a
C# object custom window
NicusorN5 25976bd
C++ lexer
NicusorN5 faf405b
Scintilla and lexilla depedencies
NicusorN5 5954f0d
C# autocomplete + line numbers
NicusorN5 3f63c62
Crash window + rgb fade demo (broken)
NicusorN5 becdb0d
Recording stacktraces in exceptions
NicusorN5 f7b98a1
Rename SetLastMessage to PrintMessage
NicusorN5 2c9f726
Fix C# compile errors
NicusorN5 70374ee
Check for errors button working
NicusorN5 e02632c
Loading default script file.
NicusorN5 35a0f20
RGB Fade script demo.
NicusorN5 3edde01
Codacy fixes + enable ASan + few updated FFIs
NicusorN5 1761147
Updated FFIs.
NicusorN5 63b299c
Fix C# compile errors.
NicusorN5 b7daa01
Fix success message being shown despite compilation failure
NicusorN5 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,6 @@ | ||
| <Solution /> | ||
| <Solution> | ||
| <Configurations> | ||
| <Platform Name="x64" /> | ||
| </Configurations> | ||
| <Project Path="Dummy/Dummy.vcxproj" Id="d87f5240-7a4a-fb1f-f513-330b76252c7e" /> | ||
| </Solution> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Solution> | ||
| <Project Path="3DRadSpace_CSharp.csproj" /> | ||
| </Solution> |
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
87 changes: 87 additions & 0 deletions
87
3DRadSpace/3DRadSpace_CSharp/Physics/ICharacterController.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,87 @@ | ||
| using System.Numerics; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace Engine3DRadSpace.Physics; | ||
|
|
||
| public class ICharacterController : ICollider | ||
| { | ||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_Move")] | ||
| private static extern void _move(IntPtr controller, ref Vector3 displacement); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_Jump")] | ||
| private static extern void _jump(IntPtr controller, float height); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_GetHeight")] | ||
| private static extern float _getHeight(IntPtr controller); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_SetHeight")] | ||
| private static extern void _setHeight(IntPtr controller, float height); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_GetRadius")] | ||
| private static extern float _getRadius(IntPtr controller); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_SetRadius")] | ||
| private static extern void _setRadius(IntPtr controller, float radius); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_SetMaxSlopeAngle")] | ||
| private static extern void _setMaxSlopeAngle(IntPtr controller, float angle); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_GetMaxSlopeAngle")] | ||
| private static extern float _getMaxSlopeAngle(IntPtr controller); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_SetGravity")] | ||
| private static extern void _setGravity(IntPtr controller, ref Vector3 gravity); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_GetGravity")] | ||
| private static extern Vector3 _getGravity(IntPtr controller); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_IsGrounded")] | ||
| [return: MarshalAs(UnmanagedType.I1)] | ||
| private static extern bool _isGrounded(IntPtr controller); | ||
|
|
||
| [DllImport("3DRadSpace.FFI.dll", EntryPoint = "E3DRSP_ICharacterController_Destroy")] | ||
| private static extern void _destroy(IntPtr controller); | ||
|
|
||
| public void Move(Vector3 displacement) | ||
| { | ||
| _move(_handle, ref displacement); | ||
| } | ||
|
|
||
| public void Jump(float height) | ||
| { | ||
| _jump(_handle, height); | ||
| } | ||
|
|
||
| public float Height | ||
| { | ||
| get => _getHeight(_handle); | ||
| set => _setHeight(_handle, value); | ||
| } | ||
|
|
||
| public float Radius | ||
| { | ||
| get => _getRadius(_handle); | ||
| set => _setRadius(_handle, value); | ||
| } | ||
|
|
||
| public float MaxSlopeAngle | ||
| { | ||
| get => _getMaxSlopeAngle(_handle); | ||
| set => _setMaxSlopeAngle(_handle, value); | ||
| } | ||
|
|
||
| public Vector3 Gravity | ||
| { | ||
| get => _getGravity(_handle); | ||
| set => _setGravity(_handle, ref value); | ||
| } | ||
|
|
||
| public bool IsGrounded() | ||
| { | ||
| return _isGrounded(_handle); | ||
| } | ||
|
|
||
| public ICharacterController(IntPtr natPtr) : base(natPtr, _destroy) | ||
| { | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.