]> git.lizzy.rs Git - irrlicht.git/commitdiff
IBillboardSceneNode got functions to access meshbuffers.
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>
Tue, 8 Feb 2022 21:00:12 +0000 (21:00 +0000)
committersfan5 <sfan5@live.de>
Wed, 9 Feb 2022 18:09:04 +0000 (19:09 +0100)
So uv-coordinates can now be modified directly (previously only possible via texture matrix).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6299 dfc29bdd-3216-0410-991c-e03cc46cb475

changes.txt
include/IBillboardSceneNode.h
source/Irrlicht/CBillboardSceneNode.h

index 7da17ee7fcc45eae1435d35e509c895259d12566..4bbdae64325396d35208f7ce86af49aa6f52c080 100644 (file)
@@ -9,6 +9,7 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point)
 \r
 --------------------------\r
 Changes in 1.9 (not yet released)\r
+- IBillboardSceneNode got functions to access meshbuffers. So uv-coordinates can now be modified directly (previously only possible via texture matrix).\r
 - vector3d scalar operator/ and operator/= no longer multiply by the inverse but use the expected division. \r
   Costs some speed, but fixes floating point troubles caused by this optimization (like x/x no longer being 1.0).\r
 - Add equals and set_data functions to core::array for easier working with blocks of data.\r
index 638465613cb29346b053230b2856d76570d731f1..3148bbc70bbce59b2cf033a3e979a2c37801ee30 100644 (file)
@@ -12,6 +12,7 @@ namespace irr
 namespace scene\r
 {\r
        class ICameraSceneNode;\r
+       class IMeshBuffer;\r
 \r
 //! A billboard scene node.\r
 /** A billboard is like a 3d sprite: A 2d element,\r
@@ -74,6 +75,17 @@ public:
            That is why the usual getBoundingBox will return a "safe" boundingbox which is guaranteed\r
            to contain the billboard. While this function can return the real one. */\r
        virtual const core::aabbox3d<f32>& getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera) = 0;\r
+\r
+       //! Get the amount of mesh buffers.\r
+       /** \return Amount of mesh buffers (IMeshBuffer) in this mesh. */\r
+       virtual u32 getMeshBufferCount() const = 0;\r
+\r
+       //! Get pointer to a mesh buffer.\r
+       /** NOTE: Positions and normals of this meshbuffers are re-calculated before rendering.\r
+       So this is mainly useful to access/modify the uv-coordinates.\r
+       \param nr: Zero based index of the mesh buffer.\r
+       \return Pointer to the mesh buffer or 0 if there is no such     mesh buffer. */\r
+       virtual IMeshBuffer* getMeshBuffer(u32 nr) const = 0;\r
 };\r
 \r
 } // end namespace scene\r
index 98e965bef153b76b00d9c907544710ffe37b439a..4f3ece26ad6d6039f3eb55ea0a48946b20685fa9 100644 (file)
@@ -72,6 +72,20 @@ public:
        //! Get the real boundingbox used by the billboard (which depends on the active camera)\r
        virtual const core::aabbox3d<f32>& getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera) _IRR_OVERRIDE_;\r
 \r
+       //! Get the amount of mesh buffers.\r
+       virtual u32 getMeshBufferCount() const\r
+       {\r
+               return Buffer ? 1 : 0;\r
+       }\r
+\r
+       //! Get pointer to the mesh buffer.\r
+       virtual IMeshBuffer* getMeshBuffer(u32 nr) const\r
+       {\r
+               if ( nr == 0 )\r
+                       return Buffer;\r
+               return 0;\r
+       }\r
+\r
        //! Returns type of the scene node\r
        virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_BILLBOARD; }\r
 \r