Giter VIP home page Giter VIP logo

unitysceneexport2physx3's Introduction

UnitySceneExport2PhysX3

This is a unity editor tool to help game server developer to rebuild the physics of the client scene using PhysX 3.x or newer.

You can use a simple export button as shown below to export your scene to a xml(or binary) file.

Then you can rebuild your scene using C++ with a few line of codes like below:

bool PhysicsSceneManager::ParseFromCollectionFile()
{
	PxCollection* shared = NULL;
	PxCollection* collection = NULL;
	char *filename = "your scene file path";

	PxDefaultFileInputData inputStream(filename);

	collection = PxSerialization::createCollectionFromXml(inputStream, *m_cooking, *m_registery, shared);

	m_scene->addCollection(*collection);

	return true;
}

Shape Type Supported

  • Sphere
  • Plane(No need to support)
  • Capsule
  • Box
  • Convex Mesh
  • Triangle Mesh
  • Height Field

How to use

Import the package

Import the UnityPhsyxExport.unitypackage package to your project and refer to the settings below.

  1. Unity5.5 or higher Check if there is a mcs.rsp in "Assets/" folder, if not exist, create it. Then add a line "-unsafe" and save the file, and reopen unity will solve the error.

  2. other Unity version Check if there is a gmcs.rsp in "Assets/" folder, if not exist, create it. Then add a line "-unsafe" and save the file, and reopen unity will solve the error.

Use

  1. Open Editor Window: Window -> PhysXExport -> OpenWindow;
  2. Export Selected Scene: Click one scene in the editor window

Notes

  1. The PhysX lib this Project use is PhysX 3.3
  2. Attached with this tool is three project:
    • PxSerializationProject: C++ encapsulation of PhysX API exported to Unity, with Windows and MacOs supported.
    • UnityProject: C# encapsulation of PhysX API used to export scene and the editor window code.
    • PxVisualizationProject: A visualization tool to check the output xml scene file using GLUT and openGL, with windows and MacOS supported.

unitysceneexport2physx3's People

Contributors

tnqiang avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.