Skip to content

YuanWeiChen16/OpenMesh-Unity-dll

Repository files navigation

Unity_OpenMesh_dll

Some unity project want use OpenMesh datastract, to rewrite OpenMesh datastract is almost impossible, so use dll to do that.

open DLL1_visualstudio to modify dll copy dll file to DLLtest_unity to test it.

How to build openmesh dll to unity

step 1

download openmesh source code.

step 2

use cmake to make VisualStudio format file.Configure selelct Visual Studio version(I used Visual Studio 2017) and x64 platform because unity is 64 bytes, and Generate. May have some error just ignore it.

step 3

open cmake made VisualStudio project and build it, It will generate two .lib file "OpenMeshCore.lib""OpenMeshTools.lib" in release x64 mode or "OpenMeshCored.lib""OpenMeshToolsd.lib" in debug x64 mode.

step 4

create a VisualStudio dll project.

step 5

copy two lib file and Openmesh sorce code Foler /src/OpenMesh/core /src/OpenMesh/Tools to VisualStudio dll project and change project setting and add preprocessor define

_CRT_SECURE_NO_WARNINGS
_SCL_SECURE_NO_WARNINGS
_USE_MATH_DEFINES
NOMINMAX
_MBCS

and include them in you dll.h flie like this.

step 6

write your owns API from OpenMesh to Unity in visualstudio dll project and build. This will create dll file. a simple function API in dll.h file in dll.c file

step 7

create a unity project (I use unity2018.4.5.f1) add Plugins folder in Asstes floder and copy dll file to this folder you just create.

step 8

create a C# script in unity and you can use dll file to use OpenMesh:D

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published