Dive Board



NativeSensors source code

NativeSensors source code

by MasDennis on Sep 11th, 2013 12:54 PM

Hi

First of all great job! I received my dev kit last week and I'm very impressed!
I was wondering if the source code for the NativeSensors apk was available somewhere. I'd love to integrate dive support into our 3D engine.
Thanks!

Dennis

MasDennis

Posts: 2

Joined: 11.09.2013


Re: NativeSensors source code

by kwx on Sep 11th, 2013 22:02 PM

FWIW, in my HMDCoaster demo, I used the default Android orientation sensor which merges gyroscope and accelerometer data. This works ok, though its rather aggressive smoothing may make it a bit laggier than Stefan's NativeSensors which does its own sensor fusion.

See http://developer.android.com/guide/topi ... ition.html. Something like this (from native code):

<br />    engine&#46;sensorManager = ASensorManager_getInstance();<br />    engine&#46;accelerometerSensor = ASensorManager_getDefaultSensor(engine&#46;sensorManager,<br />            11 /* SENSOR_TYPE_ROTATION_VECTOR */);<br />   // &#46;&#46;&#46;<br />                    while (ASensorEventQueue_getEvents(engine&#46;sensorEventQueue,<br />                            &amp;event, 1) &gt; 0) {<br />                        engine&#46;rx = event&#46;acceleration&#46;x;<br />                        engine&#46;ry = event&#46;acceleration&#46;y;<br />                        engine&#46;rz = event&#46;acceleration&#46;z;<br />                        engine&#46;rw = sqrt(1&#46;0f - engine&#46;rx*engine&#46;rx -<br />                            engine&#46;ry*engine&#46;ry -engine&#46;rz*engine&#46;rz);<br /><br />  // &#46;&#46;&#46;<br />        /* Undo screen rotation, from getWindowManager()&#46;getDefaultDisplay()&#46;getRotation()*/<br />        glRotatef(eng-&gt;rot * 90&#46;0f, 0&#46;0f, 0&#46;0f, 1&#46;0f);<br /><br />        /* Apply rotation vector&#46; */<br />        float theta = 2&#46;0f * acos(eng-&gt;rw);<br />        float s = sin(theta / 2&#46;0f);<br />        glRotatef(-theta * 180/M_PI, eng-&gt;rx / s, eng-&gt;ry / s, eng-&gt;rz / s);<br /><br />        /* Orientation sensor is relative to a phone lying horizontally&#46; Look forward&#46; */<br />        glRotatef(90&#46;0f, 1&#46;0f, 0&#46;0f, 0&#46;0f);<br />

kwx

Posts: 13

Joined: 19.07.2013


Re: NativeSensors source code

by MasDennis on Sep 12th, 2013 09:18 AM

Thanks for this! I'll give it a try.

MasDennis

Posts: 2

Joined: 11.09.2013


Re: NativeSensors source code

by sasuke2690 on Jun 15th, 2022 06:28 AM

Thank you for sharing this intriguing information; I am now learning this section and would like to learn more in order to better grasp it. Spider solitaire 2 suit is a fascinating card game, I really find it difficult to play because I have to arrange the cards in descending order, randomly draw cards that make the arrangement order messed up, to win the battle. Winning this game is a miracle for me

sasuke2690

Posts: 1

Joined: 15.06.2022


Re: NativeSensors source code

by Peter Parker on Dec 20th, 2023 07:14 AM

Explore the Splendor of Dubai with a Luxurious Yacht Rental

Introduction:

Dubai, a city known for its opulence and breathtaking skyline, offers an array of experiences that cater to luxury and adventure. Among these, yacht rental Dubai stands out as a premier choice for those seeking to explore the city’s coastal beauty in style. Whether you're planning a special occasion or simply looking to indulge in a day of luxury, yacht rentals Dubai provide an unparalleled experience.

Why Choose a Yacht Rental in Dubai?

Yachts rental Dubai services offer a unique vantage point to view the iconic landmarks of this vibrant city. From the majestic Burj Al Arab to the serene Palm Jumeirah, sailing on a yacht allows you to appreciate these sights away from the bustling city streets. Rent yacht Dubai options range from intimate boats perfect for couples to larger vessels equipped for parties and events, ensuring that there’s a perfect yacht for every occasion.

Yacht for Rent in Dubai: Perfect for Every Occasion

Whether it’s a romantic getaway, a family outing, or a corporate event, yachts for rent in Dubai cater to all your needs. Each yacht is equipped with state-of-the-art facilities and offers services like catering, entertainment, and personalized itineraries, making your time on the water truly memorable.

Experience the Luxury of Yacht for Rent Dubai

Opting for a yacht for rent Dubai is more than just renting a boat; it’s about experiencing the epitome of luxury and comfort. These yachts are designed to provide a lavish experience, with spacious decks, elegant lounges, and modern amenities that ensure your journey is as comfortable as it is exciting.

Peter Parker

Posts: 29

Joined: 20.12.2023


Re: NativeSensors source code

by yohannathomas on Jun 30th, 2024 14:37 PM

Exploring the mypaperhelp.com reviews was a significant find for me as a student. The detailed analysis of their services, including writing quality, pricing, and user experiences, offered a comprehensive understanding of what to expect. The balanced review, highlighting both the strengths and areas for improvement, was particularly useful.

yohannathomas

Posts: 2

Joined: 30.06.2024


STATISTICS


Total posts: 144407


Total topics: 34846


Total members: 42389


Newest member: Daniel G.