Auto-updating animated selectors / scene triangle selection
-
- 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
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.
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
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
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
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???
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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?
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
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?
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?
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way