Revision: 1919
Author:
pc0...@gmail.com
Date: Wed Apr 3 06:40:48 2013
Log: Fixes for latest Irrlicht updates.
http://code.google.com/p/tubras/source/detail?r=1919
Modified:
/trunk/include/TCameraNode.h
/trunk/src/TCameraNode.cpp
/trunk/tools/irrb/.pydevproject
/trunk/tools/irrlicht/extensions/CGUISceneNode.h
=======================================
--- /trunk/include/TCameraNode.h Sat Jan 9 12:52:25 2010
+++ /trunk/include/TCameraNode.h Wed Apr 3 06:40:48 2013
@@ -79,6 +79,9 @@
//! Binds the camera scene node's rotation to its target position and
vice vera, or unbinds them.
virtual void bindTargetAndRotation(bool bound);
+ //! Updates the matrices without uploading them to the driver
+ virtual void updateMatrices();
+
//! Queries if the camera scene node's rotation and its target position
are bound together.
virtual bool getTargetAndRotationBinding(void) const;
=======================================
--- /trunk/src/TCameraNode.cpp Sun Apr 10 15:50:28 2011
+++ /trunk/src/TCameraNode.cpp Wed Apr 3 06:40:48 2013
@@ -233,6 +233,33 @@
{
m_targetAndRotationAreBound = bound;
}
+
+
//-----------------------------------------------------------------------
+ // u p d a t e M a t r i c e s
+
//-----------------------------------------------------------------------
+ void TCameraNode::updateMatrices()
+ {
+ core::vector3df pos = getAbsolutePosition();
+ core::vector3df tgtv = m_target - pos;
+ tgtv.normalize();
+
+ // if upvector and vector to the target are the same, we have a
+ // problem. so solve this problem:
+ core::vector3df up = m_upVector;
+ up.normalize();
+
+ f32 dp = tgtv.dotProduct(up);
+
+ if ( core::equals(core::abs_<f32>(dp), 1.f) )
+ {
+ up.X += 0.5f;
+ }
+
+ m_viewArea.getTransform(video::ETS_VIEW).buildCameraLookAtMatrixLH(pos,
m_target, up);
+ m_viewArea.getTransform(video::ETS_VIEW) *= m_affector;
+ recalculateViewArea();
+ }
+
//-----------------------------------------------------------------------
// g e t T a r g e t A n d R o t a t i o n B i n d i n g
=======================================
--- /trunk/tools/irrb/.pydevproject Wed Mar 30 13:50:58 2011
+++ /trunk/tools/irrb/.pydevproject Wed Apr 3 06:40:48 2013
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Python
3.2</pydev_property>
+<?eclipse-pydev version="1.0"?><pydev_project>
+<pydev_property
name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python
3.0</pydev_property>
</pydev_project>
=======================================
--- /trunk/tools/irrlicht/extensions/CGUISceneNode.h Sat Jun 30 14:17:07
2012
+++ /trunk/tools/irrlicht/extensions/CGUISceneNode.h Wed Apr 3 06:40:48
2013
@@ -185,10 +185,24 @@
//! Returns whether the element has focus
/** \param element Pointer to the element which is tested.
\return True if the element has focus, else false. */
- virtual bool hasFocus(IGUIElement* element) const {
- _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
- return (element == Focus);
- }
+ virtual bool hasFocus(IGUIElement* element, bool checkSubElements) const
+ {
+ _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
+ if (element == Focus)
+ return true;
+
+ if ( !checkSubElements || !element )
+ return false;
+
+ IGUIElement* f = Focus;
+ while ( f && f->isSubElement() )
+ {
+ f = f->getParent();
+ if ( f == element )
+ return true;
+ }
+ return false;
+ }
//! Returns the current video driver.
/** \return Pointer to the video driver. */