Access to main sensors on Android (DEF-1683 and DEF-1684)


#1

Basically, being able to retrieve info from camera, gyroscope, mic and control over rumble and mic for recording.
Can’t find any ref if already available :confused: Would love to experiment with them.
Btw, great job with the engine, lovin’ it. Cheers from France.


#2

The gyro is available in on_input as action.acc_x, action.acc_y and acction.acc_z - the other ones are (to my knowledge) not supported.


#3

Yes, gyro/accelerometer values come in the on_input function as acc_x, acc_y and acc_z just as Johan describes.

We currently don’t have support for camera and microphone. I’ve added camera and microphone support tickets as DEF-1683 and DEF-1684


#4

Yep, I already noticed and tried it, works well. That’s why I’m really eager to test others out ^^
Perfect ! :smile: Cheers


#5

I can see accelerometer is supported - but what about gyroscope? Can’t find that as part of the input message.


#6

Exactly, gyro is not supported. It might end up as a feature in the engine, or as a native extension as soon as we have Java support for our extension system. I have already played around with gyroscope on iOS as a native extension and I’ll make sure to extract this into a separate library project along with Android support as soon as it is possible.


#7

I downloaded and added the gyro extension to my project. However, it fails to build (extension/extension.h not found) using the old editor, but appears to build using the new editor (haven’t tried running it on an iOS device though) - is that expected?


#8

Ah, the extension uses old SDK APIs. Sorry about that. I’ll extract it to a separate repo and update it during the day.


#9

I’ve extracted the gyroscope extension to it’s own GitHub project and updated it to support the latest version of native extensions. I also added an example that uses the Defold camera extension to create a Pokemon GO kind of augmented reality experience.


Defold Gyro - The gyroscope extension