Auto-updating animated selectors / scene triangle selection

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Auto-updating animated selectors / scene triangle selection

Post by rogerborg »

SVN 2177 has committed a couple of selector goodies to the trunk.

1) Triangle selectors that are created from animated mesh scene nodes will now auto-update themselves as necessary to keep in sync with their mesh. This means that you can now do triangle selection on animated meshes. Well, you can try. Go on, try, you pansies.

2) A new method, ISceneCollisionManager::getSceneNodeAndCollisionPointFromRay() allows selection on a scene node heirarchy. It will the ray against check each node, first by bounding box, then by ray/triangle selection, to find the closest collision point, triangle and node.

Example 07.Collision demonstrates both of these, doing triangle selection on a quake 3 level and 3 animated meshes with one method call. Oh yeah, baby.

Testing would be very welcome, particularly on skinned skeletal nodes.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Pyritie
Posts: 120
Joined: Fri Jan 16, 2009 12:59 pm
Contact:

Post by Pyritie »

It's things like this that make me wish I had learnt C++ instead of Java. :B
Hive Workshop | deviantART

I've moved to Ogre.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Updating....

By the way, good work with the light manager. looks REALLY interesting.

Why do you complain about it? Java and C++ are twins, the only thing C++ might lack is a resource manager to keep the memory clean, and that EVERYTHING in Java are pointers. Other than that, if you know Java, you know C++, you just need to get used to C++ manners :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Nice one on the autoupdatingselectors... i guess... it's something that's always been asked for but really it's something that's highly inadvisable in most cases innit? Updating all those triangles could be costly so instead of taking a cheaper route newbs will take this route and be all like awww man wah mah frayme rayt sew loh???
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

The selector will only update if its node is hit with a ray-box check, and it will only update if the animation frame has actually changed since the last time the selector was updated. (i.e. if you create a selector from an "animated" node that doesn't actually animate, it'll never get updated, just as now).

What other optimisations could be applied?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

sounds pretty good actually, nice job!
Image Image Image
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Errr, hopefully I'm wrong about this, but:

Frame A
Box (0,0,0)-(1,1,1)

Frame B
Box (1,1,1)-(2,2,2)

Ok, I know it's an extreme case, absolutely no overlapping between the 2 aabb, but it's only for a demonstration. Btw, the aabb given here are relative to mesh's center, not node's position.

If I have a ray (1.5,-1,1.5)-(1.5,3,1.5), it will correctly not find a collision in frame A, but will it somehow update for Frame B? Or is my fear true and will it miss it?
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Well, the code is committed, so...
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Heh, it's not as if I used it, so...
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks Rogerborg! That's really interesting. I'll try to get the last SVN and check this.

I really appreciate the fact that you update the demos to show the new implementation.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Great, thanks. At this point, it's definitely "experimental", so bug reports will be both welcome, and expected.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply