-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add Ogre2Heightmap functionality #386
Changes from 101 commits
025f72a
1cff215
e5979b8
fc89bef
c5c077c
8033623
a82820c
b5c639e
b664ade
d6808b8
e940e9a
92e8fbf
11cd876
88cfd40
db609f3
bc12f40
fcf51b1
797675b
7046608
d55ee47
01aeec2
62bb629
032ce0f
adfdb05
24fb7df
72f23ab
96b2eb5
5e2f7b5
21b5993
c2bbbe9
2e9d62e
b37ab76
523a5cc
0df4dd4
b9e8032
5d1bbb6
24a67ad
9a381e2
175fcae
fb0fb6e
7816937
970d862
9f15486
d3adfbe
31b4960
60391e1
d93cc18
8c2ec12
84513fa
029cd59
f951593
34c31d0
c19ec56
d3ce87d
c07bf60
22bc5c1
8480e71
2e75b61
fe97c66
5f53934
0818a0f
aacbdcc
83e8567
a714833
ed8fc4e
74a6d5d
835c559
b88ff85
6cc6f9a
cd3a095
872caf6
343268d
e17406e
44b3a6f
3f3f372
b295710
9e4243d
fcf3315
1b1ab13
84f5b1b
82bdd43
147232f
66f59c1
7d22d26
38c74c7
373fd9d
f53d5db
0d1999e
588100c
20e24e9
93599aa
be61509
baf8cff
4c08baa
1fb65fc
b75531c
226ecaf
93d88e1
24d957a
27ea80e
383d80e
6715cbb
260255b
6894fd3
19d922c
c9d5a17
bb0119b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*:*/Terra/*.h |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,108 @@ | ||||||||
/* | ||||||||
* Copyright (C) 2021 Open Source Robotics Foundation | ||||||||
* | ||||||||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||
* you may not use this file except in compliance with the License. | ||||||||
* You may obtain a copy of the License at | ||||||||
* | ||||||||
* http://www.apache.org/licenses/LICENSE-2.0 | ||||||||
* | ||||||||
* Unless required by applicable law or agreed to in writing, software | ||||||||
* distributed under the License is distributed on an "AS IS" BASIS, | ||||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||
* See the License for the specific language governing permissions and | ||||||||
* limitations under the License. | ||||||||
* | ||||||||
*/ | ||||||||
|
||||||||
#ifndef IGNITION_RENDERING_OGRE2_OGRE2HEIGHTMAP_HH_ | ||||||||
#define IGNITION_RENDERING_OGRE2_OGRE2HEIGHTMAP_HH_ | ||||||||
|
||||||||
#include <memory> | ||||||||
|
||||||||
#include "ignition/rendering/base/BaseHeightmap.hh" | ||||||||
#include "ignition/rendering/ogre2/Ogre2Geometry.hh" | ||||||||
|
||||||||
// Ignoring warning: "non dll-interface class | ||||||||
// 'ignition::rendering::v5::Heightmap' used as base for dll-interface class" | ||||||||
// because `Heightmap` and `BaseHeightmap` are header-only | ||||||||
#ifdef _MSC_VER | ||||||||
#pragma warning(push) | ||||||||
#pragma warning(disable:4275) | ||||||||
#endif | ||||||||
|
||||||||
namespace Ogre | ||||||||
{ | ||||||||
class Camera; | ||||||||
class Terra; | ||||||||
} | ||||||||
|
||||||||
namespace ignition | ||||||||
{ | ||||||||
namespace rendering | ||||||||
{ | ||||||||
inline namespace IGNITION_RENDERING_VERSION_NAMESPACE { | ||||||||
// | ||||||||
// Forward declaration | ||||||||
class Ogre2HeightmapPrivate; | ||||||||
|
||||||||
/// \brief Ogre implementation of a heightmap geometry. | ||||||||
class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Heightmap | ||||||||
: public BaseHeightmap<Ogre2Geometry> | ||||||||
{ | ||||||||
/// \brief Constructor | ||||||||
/// \param[in] | ||||||||
public: explicit Ogre2Heightmap(const HeightmapDescriptor &_desc); | ||||||||
|
||||||||
/// \brief Destructor | ||||||||
public: virtual ~Ogre2Heightmap() override; | ||||||||
|
||||||||
// Documentation inherited. | ||||||||
public: virtual void Init() override; | ||||||||
|
||||||||
// Documentation inherited. | ||||||||
public: virtual void PreRender() override; | ||||||||
|
||||||||
/// \brief Returns NULL, heightmaps don't have movable objects. | ||||||||
/// \return Null pointer. | ||||||||
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. Always return Null ?
Suggested change
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. This is true in ogre 1.x but looking at the Ogre2Heightmap::OgreObject() implementation, it returns an |
||||||||
public: virtual Ogre::MovableObject *OgreObject() const override; | ||||||||
|
||||||||
/// \brief Returns NULL, heightmap materials don't inherit from | ||||||||
/// MaterialPtr. | ||||||||
/// \return Null pointer. | ||||||||
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. Always return Null ? 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. yeah, looks like still always returns null. Textures are specified through |
||||||||
public: virtual MaterialPtr Material() const override; | ||||||||
|
||||||||
/// \brief Has no effect for heightmaps. The material is set through a | ||||||||
/// HeightmapDescriptor. | ||||||||
/// \param[in] _material Not used. | ||||||||
/// \param[in] _unique Not used. | ||||||||
public: virtual void SetMaterial(MaterialPtr _material, bool _unique) | ||||||||
override; | ||||||||
|
||||||||
/// \internal | ||||||||
/// \brief Retrieves the internal Terra pointer | ||||||||
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.
Suggested change
|
||||||||
/// \return internal Terra pointer | ||||||||
public: Ogre::Terra* Terra(); | ||||||||
|
||||||||
/// \internal | ||||||||
/// \brief Must be called before rendering with the camera | ||||||||
/// that will perform rendering. | ||||||||
/// | ||||||||
/// May update shadows if light direction changed | ||||||||
/// \param[in] _camera Camera about to be used for rendering | ||||||||
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.
Suggested change
|
||||||||
public: void UpdateForRender(Ogre::Camera *_activeCamera); | ||||||||
|
||||||||
/// \brief Heightmap should only be created by scene. | ||||||||
private: friend class OgreScene; | ||||||||
|
||||||||
/// \brief Private data class | ||||||||
private: std::unique_ptr<Ogre2HeightmapPrivate> dataPtr; | ||||||||
}; | ||||||||
} | ||||||||
} | ||||||||
} | ||||||||
#ifdef _MSC_VER | ||||||||
#pragma warning(pop) | ||||||||
#endif | ||||||||
|
||||||||
#endif |
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.
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.
Is the new version ok?
I can't describe HeightmapDescriptor because I didn't write it.
This is a copy paste from OgreHeightmap.hh
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.
something like
Parameters that describe how a heightmap should be loaded.
should suffice.this is needed to fix: https://github.com/ignitionrobotics/ign-rendering/pull/386/checks?check_run_id=3576496054