Skip to content

Conversation

@AlexJ95
Copy link

@AlexJ95 AlexJ95 commented Jun 28, 2019

This pullrequest changes
This PR adds 2 overloaded methods setEntityLookAt, which add the option to make an entity look at another one or at a given point in world coordinates.

Also it adds a GetEntityPose method, which just was missing. It gives you the position and rotation of an entity.

Tested on:

OpenCV => 4.1.0
Operating System / Platform => Windows 10 64 Bit
Compiler => Visual Studio 2017

* @param tvec translation vector
* @param invert return the inverted pose
*/
CV_WRAP virtual void getEntityPose(const String& name, OutputArray R, OutputArray tvec, bool invert) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add default arguments as in getCameraPose. This is useful with python.

* @param origin entity name
* @param target targetpoint vector
*/
CV_WRAP virtual void setEntityLookAt(const String& origin, InputArray target) = 0;
Copy link
Contributor

@paroj paroj Jun 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combine both functions into one as in setCameraLookAt to allow an lookAt offset. Then you can implement lookat for an arbitrary destination if target == "".

void setEntityLookAt(const String& origin, InputArray target) CV_OVERRIDE
{

SceneNode* or = sceneMgr->getEntity(origin)->getParentSceneNode();
Copy link
Contributor

@paroj paroj Jun 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the diff suggests or is a bad variable name

@AlexJ95 AlexJ95 force-pushed the ovis-add-entity-LookAt branch from cd6d8da to 51b16a8 Compare July 1, 2019 22:10
@paroj
Copy link
Contributor

paroj commented Jul 2, 2019

@alalek 👍

@opencv-pushbot opencv-pushbot merged commit 51b16a8 into opencv:master Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants