-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BB.LeapMotion Suggestions #40
Comments
Awesome improvements with #42. Here are some thoughts:
|
hey Brannon i have worked on the new suggestion, but i would like to talk to you to clear some things out, maybe we can skype tomorrow, let me know. Thanks ! |
Hey Fabian, great! I will open skype now and see if there is a good time we On Thu, Mar 31, 2016 at 3:38 PM, Fabian Valencia [email protected]
|
Hey @cfvalencia9277, I've got a few suggestions for the Leap Motion module:
getLeapData(...)
functionality in theBB.LeapMotion()
constructor instead of as it's own function. There is no real use case to use this module without needed whatgetLeapData(...)
provides, so we might as well put it in the constructor. Besides, in JavaScript it is the convention to have any function that begins withget
return a value instead of simply being avoid
function.getLeapData(...)
so that itswidth
andheight
properties can be accessed. Instead we should pass inwidth
andheight
(anddepth
) properties in the constructor with the option to update/alter them after construction via some method as well.config-object
style of initializing constructors that looks like this:vs
This also allows us to easily have defaults if a property is not included in the config object. That looks like this in code.
4. Have you seen the documentation for defining/mapping "Interaction Boxes" when using the LeapMotion? The way that the leap frame data is used varies dependent on if it is being used in a 2D or 3D scene, so we should have some way of mapping for 2D vs 3D etc. I really like how ofxLeapMotion handles this, particularly these three methods (see here for source). Perhaps we could adopt that style.
5. Because we would like to eliminate the need for canvas, it would be helpful if
canvasX
andcanvasY
were simply renamed tox
andy
. Down the road I'm hoping to integrate this leap module withBB.Pointer
, especially because the idea of a leap motion as a device havingx
,y
andz
properties doesn't really make sense, but rather the leap object could be funneled into aBB.Pointer
instance and then it would extract that data from a finger (kind of like howBB.MouseInput
works withBB.Pointer
to provide it with added functionality.6. It is important for us to have access to at least all of the functionality that the base SDK provides, so it would be worth having a
BB.LeapMotion.lastFrame
property that begins asnull
and then in eachcontroller.on("frame")
callback it assigns the current value offrame
tolastFrame
. That way we can have access to properties likehands
, etc...7. Finally, it would be nice to have access to all of the functionality in
BB.LeapMotion
via an event-style API as well as the current property-access API, so that if the programmer preferred to use this style if they preferred:vs
This is less pressing than the other methods however. Plus, I have been working on but have yet to push a
BB.EventEmitter
class thatBB.LeapMotion
could extend from which would make this easier. I will ping you when that is included in the library core and then these updates can be made so you can hold off on implementing no. 7 for now.I'll be back in the studio on Friday if you have any questions. Thanks for your contributions!
The text was updated successfully, but these errors were encountered: