Comments (2)
What about add integration with Unity3D? The most popular game engine with C# support.
from sharpnav.
Unity3D uses a different naming convention for everything, so my method of cross-engine support fails. I assume regular C# naming conventions are used - for example, that in Vector3
, the three components are X
, Y
, and Z
. In Unity, however, they follow a different naming convention, so the components are x
, y
, and z
. Simple namespace substitution won't work here.
If you take a look at the top of a most of the C# files in the project, you'll see this block:
using SharpNav.Geometry;
#if MONOGAME
using Vector3 = Microsoft.Xna.Framework.Vector3;
#elif OPENTK
using Vector3 = OpenTK.Vector3;
#elif SHARPDX
using Vector3 = SharpDX.Vector3;
#endif
(example: https://github.com/Robmaister/SharpNav/blob/master/Source/SharpNav/Heightfield.cs)
If performance weren't a concern (trying to be realtime-ish, so it is), I would try to wrap Unity vectors in some sort of a wrapper class but since there's a lot of vector math, I wouldn't be surprised if SharpNav ran at less than half the speed it does now.
Another option would be a ToUnityVector()
function and/or implicit cast in the Standalone Vector3 implementation, but this would still have a fair bit of overhead when you want to do anything with the navmesh from Unity (internally stored in the Standalone Vector3 format) and only be syntax sugar over the same way you'd use SharpNav in Unity with the Standalone build.
To make the Unity version act the same way as other versions (internal storage in the engine Vector format), there would need to be some more complex preprocessor or IL stage manipulation of the program to use the engine Vector format.
from sharpnav.
Related Issues (20)
- Agents do not move when requested target is on the same polygon HOT 4
- Using SharpNav.SharpDX in conjunction with SharpDX 3.0.1 HOT 4
- FixupCorridor IndexOutOfRangeException HOT 11
- FindRandomPointAroundCircle IndexOutOfRangeException HOT 2
- No nearby polys InvalidOperationException
- Fail to compile against .NET 3.5 HOT 8
- .Obj exported from Unity3D causes System.IndexOutOfRangeException HOT 9
- OpenGL error on Example HOT 10
- .net standard version HOT 2
- ERROR HOT 1
- How to import NavMesh from Unity? HOT 1
- How are SharpNav dealing with Licenses? HOT 3
- CalcSlabEndPoints - Struct by reference needed HOT 1
- Dynamic Obstacle
- Is this library appropriate for my usage? HOT 3
- Mesh generation time. Testing on big meshes. HOT 2
- The "filter" in InitSlicedFindPath
- TiledNavMesh not lining up
- Exception: The provided PolyMesh has no vertices. HOT 1
- MergeCorridorStartMoved does not resize the path HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpnav.