[Bf-committers] Sensors API for GE on Android

Campbell Barton ideasman42 at gmail.com
Thu Jul 19 09:41:21 CEST 2012


Hi, adding a python api to begin with seems reasonable (keep in mind
we may wan't C/api for other parts of blender to access but this
shouldn't be a problem)

Check on...
http://www.blender.org/documentation/blender_python_api_2_63_release/bge.logic.html#bge.logic.mouse
http://www.blender.org/documentation/blender_python_api_2_63_release/bge.events.html

There could be...

bge.logic.gyroscope
bge.logic.gyroscope.is_connected
bge.logic.gyroscope.activate()
bge.logic.gyroscope.deactivate()
quat = bge.logic.gyroscope.angular_velocity  # rotation as a quaternion
data = bge.logic.gyroscope.data  # raw data from gyro -- if this is
useful in some cases it have besides quaternion access.


On Thu, Jul 19, 2012 at 12:41 AM, Alexandr Kuznetsov <kuzsasha at gmail.com> wrote:
> Hi
>
>
> Android and other mobile devices have different input methods than
> traditional computers.
>
>
> I wrote a mouse emulator which uses touch, but there still some problems.
> For example, Android  knows the cursor position only when device is touch,
> aka left mouse is pressed. Therefore, when we press in different places,
> courses just jumps from one position to the next. Hopefully, it will be
> less of a problem when we have multitouch API and can use explicitly use it
> instead mouse emulator.
>
>
> I want to add Accelerometer and Gyroscope this or next week. Accelerometer
> and Gyroscope provide streams of information that can affect performance.
> Therefore I think developers should explicitly enable and disable api.
> dfelinto proposed those sensors should be implemented as python API first.
>   For devices or OSs that don't have Accelerometer and Gyroscope, we can
> provide fake api. Also, I think, gyroscope and accelerometer should use the
> same api and be specified through enum and return a vector array of values.
>
>
> How would you like to see this implemented? Also, do you want any data
> conversions/helper functions? Gyroscope data is a little complicated:
> http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro
>
>
>
> Best,
>
> Alex
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell


More information about the Bf-committers mailing list