[fixed]Documentation Fixes

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
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

[fixed]Documentation Fixes

Post by REDDemon »

1) SViewFrustum.

Documentation mistyping at line 22.

Frustum view has 8 points not 4.


2) SViewFrustum

Documentation missing line 129.

ClassifyPoint relations need a normalized normal. This is not told in the documentation.

demonstration:

assume the ZY PLane (the normal to that plane is the X vector)
so
Normal(1,0,0)
and
D = 0;

take the point (3,0,0)

if the Normal is not normalized so assume (2,0,0)
Then distance from the point will return 6 instead of 3.



3)
file "matrix4.h"

line 1064

Transforming a vector like this way requires an affine matrix. This is not
told in documentation. So the method theorically won't work correctly with perspective matrices
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Documentation Fixes

Post by hybrid »

Not sure what you mean about the matrix problem. The transform is correct for a 3-component vector. We assume a '1' in the fourth component. If you need a full 4x4 transform use the additional 4-component output transform. The rest is fixed.
BTW: I didn't change just the classifyPointRelation comment, but added a general hint to the class. Because also other methods rely on a normalized normal. And your example didn't give wrong results, IMHO, but a different D point would.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: [fixed]Documentation Fixes

Post by REDDemon »

And your example didn't give wrong results, IMHO, but a different D point would.
D that was not the point :)

D is just the fourth member of the plane equation. My example shows that using as normal (1,0,0) the result is 3. Using as normal(2,0,0) (of course if you can call it "normal" XD) the result becomes 6.. assumed that the plane is the same (always YZ) there's no reason for wich the function should return different distances for the same point (3,0,0).

Just signaled functions wich have failed unit testing. (i'm not testing the whole engine, but just functions wich I use :) ).

For the matrix just forget that irrlicht uses LH coord system. so the column wich I expect to be used is left as (0,0,0,1) while the line wich remains untouched in opengl (the 4th) is used by irrlicht
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [fixed]Documentation Fixes

Post by hybrid »

Maybe you mean a different method in plane3d then. classifyPointRelation just returns an enum value, which says in front, back, or planar. The inner calculation of the dot product would be wrong, though. And this could lead, with a different D value, to a wrong classification. At least that's what I saw in the code. Didn't do any test cases, yet. Anyway, a plane with a non-normalized normal will fail in many cases. So it's best to avoid it.
Post Reply