Skip to content
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
774d963
Added bindings for camera methods
coolteemf Sep 14, 2020
cac543a
Merge fix
coolteemf Dec 8, 2020
c7fbef5
Clean-ups before release (#82)
jnbrunet Jan 14, 2021
a3804e9
Improve CMake for v20.12 (#83)
guparan Jan 14, 2021
3ed6f22
[cmake] Fix rpath for MacOS on SOFA relocatable dependencies
jnbrunet Jan 15, 2021
418bbdc
[cmake] Fix rpath for MacOS on SOFA relocatable dependencies (part 2)
jnbrunet Jan 15, 2021
4651242
[examples] Add an advanced timer scene demonstration (#84)
jnbrunet Jan 15, 2021
5a3094e
Update license before the release (#85)
jnbrunet Jan 15, 2021
82c98ce
[CMake] Re-enable building SofaPython3 alongside SofaPython
guparan Jan 15, 2021
b7bdc97
Rename contributors.txt to Authors.txt
hugtalbot Jan 16, 2021
8d4bf9e
Add badges for Doc and License (#89)
hugtalbot Jan 16, 2021
a852361
Update examples 202101 (#86)
hugtalbot Jan 16, 2021
2639e66
Fix institutions (#88)
hugtalbot Jan 16, 2021
963202e
[cmake] Fix compilation issue on MacOS (#90)
jnbrunet Jan 18, 2021
19bf4d8
Added a binding for getLookAtFromOrientation. (#91)
ScheiklP Jan 18, 2021
af21c4a
[cmake] Export SP3 cmake tools for usage in external projects (#94)
jnbrunet Jan 21, 2021
a0a7e56
Wider RPATH for python modules (#95)
guparan Jan 21, 2021
a40e0ed
[CMake] Simplify RPATH (#96)
guparan Jan 21, 2021
727556e
[Examples] Fix scenes before the release
jnbrunet Jan 22, 2021
f63aec7
[Examples] Remove the pygame scene as it is broken without glew bindi…
jnbrunet Jan 22, 2021
530ed03
[CMake] FIX SofaPython3Tools inclusion (#99)
guparan Jan 22, 2021
ae814a4
[cmake] Remove RPATH debug message (#101)
jnbrunet Jan 22, 2021
74a8b73
[SofaBaseTopology] Fix binding entry point (#103)
jnbrunet Jan 26, 2021
b9d1211
[Plugin] Change the initialization order of the Prefab (#105)
jnbrunet Jan 26, 2021
5012482
[examples] Remove warning and dep (#107)
hugtalbot Jan 27, 2021
65d008c
[Plugin] Remove unused files
jnbrunet Jan 21, 2021
d06a2cc
[BaseCamera] added bindings for screen/world point conversion
coolteemf Feb 1, 2021
4de4bec
Merge remote-tracking branch 'upstream/master'
coolteemf Feb 1, 2021
d1d5f2f
[BaseCamera] Removed commented bindings
coolteemf Feb 1, 2021
289c369
[cmake] Fix missing module path for external projects (#104)
jnbrunet Jan 26, 2021
52d4ada
[BaseCamera] Added binding getLookAtFromOrientation
coolteemf Feb 16, 2021
47e698f
[cmake] CMake config was exporting the wrong python version (#116)
jnbrunet Feb 24, 2021
545b6e0
Merge remote-tracking branch 'origin/old' into v20.12
coolteemf Mar 8, 2021
453bd78
Merge branch 'v20.12' into Binding_BaseCamera
coolteemf Mar 8, 2021
e115e97
Merge branch 'master' into Binding_BaseCamera
coolteemf May 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ void moduleAddBaseCamera(py::module &m)
return(self->getPositionFromOrientation(vec1, vec2, vec3));
});

c.def("getLookAtFromOrientation", [](BaseCamera *self, py::list p1, py::float_ p2, py::list p3) {
sofa::defaulttype::Vec3 vec1;
double vec2;
sofa::defaulttype::Quat vec3;
vec1 = sofa::defaulttype::Vec3(py::cast<double>(p1[0]),py::cast<double>(p1[1]),py::cast<double>(p1[2]));
vec2 = py::cast<double>(p2);
vec3 = sofa::defaulttype::Quat(py::cast<double>(p3[0]),py::cast<double>(p3[1]),py::cast<double>(p3[2]),py::cast<double>(p3[3]));
return(self->getLookAtFromOrientation(vec1, vec2, vec3));
});

c.def("setCameraType", [](BaseCamera *self, int p1) {
self->setCameraType(p1);
});
Expand All @@ -141,6 +151,17 @@ void moduleAddBaseCamera(py::module &m)
self->setCameraType(0);
});

c.def("worldToScreenPoint", [](BaseCamera *self, py::list pos) {
sofa::defaulttype::Vec3 vec1;
vec1 = sofa::defaulttype::Vec3(py::cast<double>(pos[0]), py::cast<double>(pos[1]), py::cast<double>(pos[2]));
return(self->worldToScreenPoint(vec1));
});

c.def("screenToWorldPoint", [](BaseCamera *self, py::list pos) {
sofa::defaulttype::Vec3 vec1;
vec1 = sofa::defaulttype::Vec3(py::cast<double>(pos[0]), py::cast<double>(pos[1]), py::cast<double>(pos[2]));
return(self->screenToWorldPoint(vec1));
});
}

} /// namespace sofapython3