From 5c3e9500f82717550741e321d248f920babc36c7 Mon Sep 17 00:00:00 2001 From: cutealien Date: Sat, 20 Nov 2010 13:31:44 +0000 Subject: [PATCH] Add vector3d::getAs3Values (patch provided by slavik262) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3441 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 2 ++ include/vector3d.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/changes.txt b/changes.txt index ca62b2a9..16e9201c 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,7 @@ Changes in 1.8 (??.0?.2010) + - Add vector3d::getAs3Values (patch provided by slavik262) + - Add function to SViewFrustum to get corners of the near plane (patch provided by Matt Kline, aka slavik262) - ParticleFadeOutAffector::setFadeOutTime can no longer be set to invalid values diff --git a/include/vector3d.h b/include/vector3d.h index a2a9d62c..85ca45d7 100644 --- a/include/vector3d.h +++ b/include/vector3d.h @@ -394,6 +394,16 @@ namespace core array[3] = 0; } + //! Fills an array of 3 values with the vector data (usually floats). + /** Useful for setting in shader constants for example.*/ + void getAs3Values(T* array) const + { + array[0] = X; + array[1] = Y; + array[2] = Z; + } + + //! X coordinate of the vector T X;