diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 00:30:36 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 00:30:36 +0000 |
commit | 8dc465e39dd10bd23a4f24481d2bf146404596a7 (patch) | |
tree | e0da44eaee7bd4402a9844e1b68c50149cd290dd /courgette/crc.cc | |
parent | acaae862120b887d04432fd81e2c2c47cbd1256c (diff) | |
download | chromium_src-8dc465e39dd10bd23a4f24481d2bf146404596a7.zip chromium_src-8dc465e39dd10bd23a4f24481d2bf146404596a7.tar.gz chromium_src-8dc465e39dd10bd23a4f24481d2bf146404596a7.tar.bz2 |
Updates the picking library to have a PickManager and
support both not picking invisible objects and
the option to pick even if invisible.
The idea is you can do something like this
// Make a picking manager
var pm = o3djs.picking.createPickManager(rootTransform);
... // add a bunch of transforms.
// generate picking objects.
pm.update();
// Get the picking object that was created for some specific transform
var info = pm.getTransformInfo(someTransform);
// Set properties on that object related to picking
info.pickEvenIfInvisible = true;
I think this is just a first step. How an object should
be defined as pickable is up for debate. As it is,
you can basically override info.isPickable.
as in
info.isPickable = function() {
// do something custom.
}
You can also start adding things easier like
info.onPick = function() {
// do something.
}
and then write code like
info = pm.pick(worldRay);
if (info) {
info.onPick();
}
While you could have done that before there was no
easy way to find a the TransformInfo for a
specific Transform. Now you can use
PickManager.getTransformInfo
Review URL: http://codereview.chromium.org/452027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/crc.cc')
0 files changed, 0 insertions, 0 deletions