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!
DennisMasDennis
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.sensorManager = ASensorManager_getInstance();<br /> engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager,<br /> 11 /* SENSOR_TYPE_ROTATION_VECTOR */);<br /> // ...<br /> while (ASensorEventQueue_getEvents(engine.sensorEventQueue,<br /> &event, 1) > 0) {<br /> engine.rx = event.acceleration.x;<br /> engine.ry = event.acceleration.y;<br /> engine.rz = event.acceleration.z;<br /> engine.rw = sqrt(1.0f - engine.rx*engine.rx -<br /> engine.ry*engine.ry -engine.rz*engine.rz);<br /><br /> // ...<br /> /* Undo screen rotation, from getWindowManager().getDefaultDisplay().getRotation()*/<br /> glRotatef(eng->rot * 90.0f, 0.0f, 0.0f, 1.0f);<br /><br /> /* Apply rotation vector. */<br /> float theta = 2.0f * acos(eng->rw);<br /> float s = sin(theta / 2.0f);<br /> glRotatef(-theta * 180/M_PI, eng->rx / s, eng->ry / s, eng->rz / s);<br /><br /> /* Orientation sensor is relative to a phone lying horizontally. Look forward. */<br /> glRotatef(90.0f, 1.0f, 0.0f, 0.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: 4
Joined: 30.06.2024
STATISTICS
Total posts: 172055
Total topics: 41665
Total members: 44888
Newest member: Daniel G.
Meet the