BSP getasvector3df does not respect setscale

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

BSP getasvector3df does not respect setscale

Post by hendu »

If the BSP mesh is scaled by some amount, getAsVector3df should get scaled by the same amount to get correct numbers.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: BSP getasvector3df does not respect setscale

Post by hybrid »

Where does this method belong to? It's not part of the common API for all nodes, is it?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: BSP getasvector3df does not respect setscale

Post by hendu »

It's a BSP specific method, yes. But for a scaled/ rotated/ moved model, one would expect the entities in it to have moved accordingly.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: BSP getasvector3df does not respect setscale

Post by hybrid »

If you meant irr::scene::quake3::getAsVector3df then the answer is no. This simply is a helper function to convert right-handed to left-handed coords (which even does not behave like the specs in the API documentation, but that's yet another question). There's no scale to take into account, it's a simple static function without any relation to matrices.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: BSP getasvector3df does not respect setscale

Post by hendu »

The point is that it should, that's what the user would expect.

If a spawn point is at 0,0,0, but the level is moved to 1000,1000,1000, putting the camera at the spawn point coords would be wrong. Since that function is used to get the position of an entity, it's the right place to do the relative transform IMHO.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: BSP getasvector3df does not respect setscale

Post by hybrid »

Oh, I think I got the intention of the method's parameters wrong. So the string really just contains a name, not the vector represented in printed characters? Anyway, we're talking here about the mesh, not the scene node, don't we? We'd need to get the methods from the q3 scene node to get a proper scaled value. Can you show me some full code which reproduces this problem?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: BSP getasvector3df does not respect setscale

Post by hendu »

Yes, example 16 with one line added:

Code: Select all

--- main.cpp    2010-10-24 09:43:06.000000000 +0300
+++ gg.cpp      2011-10-24 15:40:20.000000000 +0300
@@ -195,6 +195,8 @@
                node = smgr->addOctreeSceneNode(geometry, 0, -1, 4096);
        }
 
+       node->setPosition(core::vector3df(1000,1000,1000));
+
        // create an event receiver for making screenshots
        CScreenShotFactory screenshotFactory(device, mapname, node);
        device->setEventReceiver(&screenshotFactory);
Post Reply