-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scale BaseAxis properly #88
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bc80023
add ogre2 arrow and axis visual
iche033 2a7c554
changelog and remove unused code
iche033 ff5d5dd
changelog
iche033 bb91a44
Scale BaseAxis properly
ahcorde d31da36
Merge remote-tracking branch 'origin/ogre2_arrow_axis' into ahcorde/f…
ahcorde 2047255
Overwrite only SetLocalScale math::Vector3d in BaseAxisVisual and rem…
ahcorde 71f4e44
changelog
iche033 a03c5c7
Merge branch 'master' into ahcorde/fix/scale_baseaxis
ahcorde 3e76ab6
Merge branch 'ahcorde/fix/scale_baseaxis' of https://github.com/ignit…
ahcorde 605242c
Fixed UNIT_VisualAxis_TEST
ahcorde 27a228b
Fixed linters
ahcorde ca745c9
Remove compiler warning in BaseAxisVisual
ahcorde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,18 @@ namespace ignition | |
public: virtual ~BaseAxisVisual(); | ||
|
||
public: virtual void Init(); | ||
|
||
public: virtual void SetLocalScale(double _x, double _y, double _z) override; | ||
|
||
public: virtual void SetLocalScale(double _scale) override; | ||
|
||
public: virtual void SetLocalScale(const math::Vector3d &_scale) override; | ||
|
||
private: ArrowVisualPtr xArrow; | ||
|
||
private: ArrowVisualPtr yArrow; | ||
|
||
private: ArrowVisualPtr zArrow; | ||
}; | ||
|
||
////////////////////////////////////////////////// | ||
|
@@ -51,25 +63,52 @@ namespace ignition | |
{ | ||
} | ||
|
||
////////////////////////////////////////////////// | ||
template <class T> | ||
void BaseAxisVisual<T>::SetLocalScale(double _x, double _y, double _z) | ||
{ | ||
xArrow->SetLocalScale(_x, _y, _z); | ||
yArrow->SetLocalScale(_x, _y, _z); | ||
zArrow->SetLocalScale(_x, _y, _z); | ||
} | ||
|
||
////////////////////////////////////////////////// | ||
template <class T> | ||
void BaseAxisVisual<T>::SetLocalScale(double _scale) | ||
{ | ||
xArrow->SetLocalScale(_scale, _scale, _scale); | ||
yArrow->SetLocalScale(_scale, _scale, _scale); | ||
zArrow->SetLocalScale(_scale, _scale, _scale); | ||
} | ||
|
||
////////////////////////////////////////////////// | ||
template <class T> | ||
void BaseAxisVisual<T>::SetLocalScale(const math::Vector3d &_scale) | ||
{ | ||
xArrow->SetLocalScale(_scale.X(), _scale.Y(), _scale.Z()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about:
this way we don't need to declare the private |
||
yArrow->SetLocalScale(_scale.X(), _scale.Y(), _scale.Z()); | ||
zArrow->SetLocalScale(_scale.X(), _scale.Y(), _scale.Z()); | ||
} | ||
|
||
////////////////////////////////////////////////// | ||
template <class T> | ||
void BaseAxisVisual<T>::Init() | ||
{ | ||
T::Init(); | ||
|
||
ArrowVisualPtr xArrow = this->Scene()->CreateArrowVisual(); | ||
xArrow = this->Scene()->CreateArrowVisual(); | ||
xArrow->SetLocalPosition(0, 0, 0); | ||
xArrow->SetLocalRotation(0, IGN_PI / 2, 0); | ||
xArrow->SetMaterial("Default/TransRed"); | ||
this->AddChild(xArrow); | ||
|
||
ArrowVisualPtr yArrow = this->Scene()->CreateArrowVisual(); | ||
yArrow = this->Scene()->CreateArrowVisual(); | ||
yArrow->SetLocalPosition(0, 0, 0); | ||
yArrow->SetLocalRotation(-IGN_PI / 2, 0, 0); | ||
yArrow->SetMaterial("Default/TransGreen"); | ||
this->AddChild(yArrow); | ||
|
||
ArrowVisualPtr zArrow = this->Scene()->CreateArrowVisual(); | ||
zArrow = this->Scene()->CreateArrowVisual(); | ||
zArrow->SetLocalPosition(0, 0, 0); | ||
zArrow->SetLocalRotation(0, 0, 0); | ||
zArrow->SetMaterial("Default/TransBlue"); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should be able to just override this version with
math::Vector3d
arg. The other two just calls this function so can be removed.