Home Tutorials Forums Articles Blogs Movies Library Employment Press

 ActionScript.org Forums Inverse Square Root
 User Name Remember Me? Password
 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 Thread Tools Rate Thread Display Modes
 07-22-2007, 03:35 PM #1 st33d Registered User   Join Date: Oct 2006 Posts: 38 Inverse Square Root I'm developing a physics engine based somewhat on Flade and the Tony Pa Vector tutorials (they Google well so I don't think I need to link them). I've ported the engine to Java and found an inverse square root method that was originally written for Quake 3 and optimised by Chris Lomont. This allows you to calculate vector normals much faster. Here's my Java version: Code: ```// Original C code by Chris Lomont static float invSqrt(float x){ float xhalf = 0.5f*x; int i = Float.floatToIntBits(x); // get bits for floating value i = 0x5f375a86- (i>>1); // gives initial guess y0 x = Float.intBitsToFloat(i); // convert bits back to float x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy return x; }``` My trouble here is before I can test it for speed in Flash I need a method for getting the floating point value of x in and out of integer bit format. Can anyone help?
 11-18-2007, 06:07 PM #2 daniele guido Registered User   Join Date: Nov 2007 Posts: 1 hi! I know it's a bit late, but.. I think who's searching for inverted sqrt would find it interesting: http://blog.je2050.de/2007/10/01/con...nd-vice-versa/

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

 Similar Threads Thread Thread Starter Forum Replies Last Post Oli-G ActionScript 2.0 2 06-02-2007 08:44 AM Damiano ActionScript 2.0 4 08-16-2006 07:59 PM mikewirth Other Flash General Questions 4 06-04-2006 03:16 PM lecasn5 Components 61 09-07-2004 11:40 AM Disjuku Simple Stuff (Newbies) 12 01-04-2004 07:39 PM

All times are GMT. The time now is 11:29 AM.

///

## Categories

 Contact Us - Home Page - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.