-
-
Notifications
You must be signed in to change notification settings - Fork 960
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
Basic Tutorial 2 - Porting from wiki #523
Conversation
Samples/Tutorials/BasicTutorial2.cpp
Outdated
|
||
//! [spotlightposrot] | ||
spotLight->setDirection(-1, -1, 0); | ||
spotLight->setPosition(Ogre::Vector3(200, 200, 0)); |
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.
Node-less positioning of light nodes is deprecated. Please change to node base positioning.
@subpage basictutorial1 | ||
If you need help with the set up, then read @ref setup. | ||
|
||
@subpage basictutorial1 <br/> |
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.
use a list instead of manual line-breaks here
Samples/Tutorials/BasicTutorial2.cpp
Outdated
//! [spotlightposrot] | ||
|
||
//! [spotlightrange] | ||
spotLight->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(50)); |
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.
you can just do ˋusing namespace Ogre;ˋ somewhere instead of using the Ogre:: prefix everywhere to keep things more readable.
7604eba
to
2f5c200
Compare
Sorry for delay. Has to reread tutorial and fix some code with last updates. |
|
||
# The Ogre Camera Class {#bt2TheOgreCameraClass} | ||
A Camera is the object we use to view our scene. A Ogre::Camera is a special object that works similar to a Ogre::SceneNode. It has methods like setPosition and yaw. You can also attach it to a SceneNode. For instance, you might want to temporarily attach your Camera to a SceneNode that follows a path through the sky to create an aerial cutscene. Just like a SceneNode the Camera's position will be relative to its parent SceneNode. The Camera is not a SceneNode (it actually inherits from the Frustum class), but for movement and rotation, you can treat it like a SceneNode. | ||
@note Starting from version 1.10 functionality related to rotate and translate camera are depricated. You should attach camera to Ogre::SceneNode and do all transofrmation with this node. |
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.
spelling: deprecated
|
||
@snippet Samples/Tutorials/BasicTutorial2.cpp spotlightposrot | ||
|
||
@note You must be wondering why we call setDirection for light source and then call the same method for related SceneNode. As long as setDirection is depricated for Light it has to be attached to SceneNode. Since SceneNode default rotation is NEGATIVE\_UNIT\_Z we need to set same value for Light. Direction for light by default is not NEGATIVE\_UNIT\_Z but in the future releases it will be replaced with this value. So this extra call of setDirection for Light could be deleted in future. In other words we need this extra move for future compatibilty. |
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.
spelling: deprecated
![](bt2_ninja3.jpg) | ||
|
||
# Shadow Types {#ShadowTypes} | ||
Ogre currently supports three types of Shadows: |
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.
actually it is six. probably it is better to just reference the enum here: https://ogrecave.github.io/ogre/api/1.10/group___general.html#ga79dcd426d291c31072c1ad6f183715d6
Samples/Tutorials/CMakeLists.txt
Outdated
@@ -14,9 +14,14 @@ file(COPY ${OGRE_CONFIG_DIR}/plugins.cfg ${OGRE_CONFIG_DIR}/resources.cfg | |||
DESTINATION ${CMAKE_BINARY_DIR}) | |||
## [discover_ogre] | |||
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic") |
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.
were you trying to get that deprecation waring? this does not seem to be needed.
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.
In all code I am porting from tutorials. Just for you not to correct me all the time.
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.
you should rather set this in cmake-gui instead of hardcoding it here
Here is the second tutorial in the Basic Tutorial series.