-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
#include "CameraWrapper.h" | ||
|
||
void margelo::CameraWrapper::loadHybridMethods() { | ||
// TODO: implement | ||
registerHybridMethod("lookAt", &CameraWrapper::lookAt, this); | ||
} | ||
|
||
void margelo::CameraWrapper::lookAt(std::shared_ptr<ManipulatorWrapper> cameraManipulator) { | ||
math::float3 eye, center, up; | ||
cameraManipulator->getManipulator()->getLookAt(&eye, ¢er, &up); | ||
_camera->lookAt({eye[0], eye[1], eye[2]}, {center[0], center[1], center[2]}, {up[0], up[1], up[2]}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "ManipulatorWrapper.h" | ||
|
||
namespace margelo { | ||
void ManipulatorWrapper::loadHybridMethods() {} | ||
} // namespace margelo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "jsi/HybridObject.h" | ||
|
||
#include <camutils/Manipulator.h> | ||
|
||
namespace margelo { | ||
using namespace filament; | ||
using namespace camutils; | ||
|
||
class ManipulatorWrapper : public HybridObject { | ||
public: | ||
explicit ManipulatorWrapper(const std::shared_ptr<Manipulator<float>>& manipulator) : _manipulator(manipulator) {} | ||
|
||
void loadHybridMethods() override; | ||
|
||
const std::shared_ptr<Manipulator<float>>& getManipulator() { | ||
return _manipulator; | ||
} | ||
|
||
private: | ||
std::shared_ptr<Manipulator<float>> _manipulator; | ||
}; | ||
} // namespace margelo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters