diff --git a/ReadMe.md b/ReadMe.md index 1813033..c242dfc 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -6,20 +6,14 @@ ### PIP installation To install for the first time: ``` -pip install git+https://github.com/petrikvladimir/pyphysx.git@master +pip install git+https://github.com/StanislavPetrovV/pyphysx.git@master ``` To update if its already installed: ``` -pip install --upgrade git+https://github.com/petrikvladimir/pyphysx.git@master +pip install --upgrade git+https://github.com/StanislavPetrovV/pyphysx.git@master ``` -Optionally, you can install in anaconda -``` -conda create -n py38 python=3.8 -conda activate py38 -conda install -c anaconda gcc_linux-64 gxx_linux-64 -pip install git+https://github.com/petrikvladimir/pyphysx.git@master -``` + ### Build from source If pip install fails, build the library from source. @@ -36,7 +30,7 @@ pip install --upgrade numpy pip install codecov pyrender imageio imageio_ffmpeg trimesh networkx numba numpy_quaternion matplotlib scipy anytree meshcat pytest-cov # Clone and build from source: -git clone https://github.com/petrikvladimir/pyphysx.git +git clone https://github.com/StanislavPetrovV/pyphysx.git python setup.py install --user ``` diff --git a/include/Scene.h b/include/Scene.h index c196a1c..a3f6ad5 100644 --- a/include/Scene.h +++ b/include/Scene.h @@ -19,13 +19,14 @@ class Scene : public BasePhysxPointer { const physx::PxBroadPhaseType::Enum &broad_phase_type, const std::vector &scene_flags, size_t gpu_max_num_partitions, - float gpu_dynamic_allocation_scale + float gpu_dynamic_allocation_scale, + physx::PxVec3 gravity ) : BasePhysxPointer() { physx::PxSceneDesc sceneDesc(Physics::get().physics->getTolerancesScale()); sceneDesc.cpuDispatcher = Physics::get().dispatcher; sceneDesc.cudaContextManager = Physics::get().cuda_context_manager; sceneDesc.filterShader = physx::PxDefaultSimulationFilterShader; - sceneDesc.gravity = physx::PxVec3(0.0f, 0.0f, -9.81f); + sceneDesc.gravity = gravity; for (const auto &flag : scene_flags) { sceneDesc.flags |= flag; } diff --git a/src/pyphysx.cpp b/src/pyphysx.cpp index 09f17f1..38634f6 100644 --- a/src/pyphysx.cpp +++ b/src/pyphysx.cpp @@ -135,12 +135,13 @@ PYBIND11_MODULE(_pyphysx, m) { .def_static("init_gpu", &Physics::init_gpu); py::class_(m, "Scene") - .def(py::init, size_t, float>(), + .def(py::init, size_t, float, physx::PxVec3>(), arg("friction_type") = physx::PxFrictionType::ePATCH, arg("broad_phase_type") = physx::PxBroadPhaseType::eABP, arg("scene_flags") = std::vector(), arg("gpu_max_num_partitions") = 8, - arg("gpu_dynamic_allocation_scale") = 1. + arg("gpu_dynamic_allocation_scale") = 1., + arg("gravity") = physx::PxVec3(0.0, 0.0, -9.81) ) .def("simulate", &Scene::simulate, arg("dt") = 1. / 60.