github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

drodriguez / gravity

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Small iPhone application showing some real physics. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

REAME file. 
drodriguez (author)
Fri Apr 24 00:33:53 -0700 2009
commit  f84bdeda7606f80779f08702a697e6d16924e754
tree    6dbb5b2d2061ade817afe3d614327d503663323c
parent  f9ffd725d290f432e23aa91ed7d66a53a84be689
gravity /
name age
history
message
file .gitignore Loading commit data...
directory Chipmunk/
directory Classes/
directory Gravity.xcodeproj/
file Gravity_Prefix.pch
file Info.plist
file LICENSE
file MainWindow.xib
file README.markdown
file ball.png
file ball.xcf
file entl.plist
file main.m
file pool-table.png
file pool-table.xcf
README.markdown

Gravity demo

Small iPhone and iPod touch application showning pool balls over a pool table under the influence of gravity, using the accelerometers from the device to know where the balls should fall.

Code Organization

“Classes” directory contains the code for the application, and “Chipmuck” contains the code for the Chipmuck physics library.

“Classes” directory

  • GRAppDelegate: Initialization code for the application.
  • GRController: Initialization code for the objects and physics. Drawing code for the OpenGL view. Delegate for both GREAGLView and UIAccelerator.
  • GREAGLView: Typical OpenGL view with delegate.
  • GRSprite: Common code for all sprites.
  • GRPoolTable: Builds the pool table static physics object. Optimization code for drawing the sprite on the device using DrawTex extension.
  • GRPoolTable: Build a ball physics object.
  • Texture2D: Loads images and turn them into OpenGL textures.

Work to do

  • Some kind of texture manager: right now each ball generates its own texture.
  • Better organization for the physics integration (passing around the space and static body doesn't seems right).
  • Implement the right physics: Chipmuck do not work for “over the table” physics.

Credits

Author: Daniel Rodríguez Troitiño (drodrigueztroitino thAT yahoo thOT es).

Using Chipmunk http://code.google.com/p/chipmunk-physics/ for the physics simulation. Chipmuck 4.1.0 code is included.

Using Texture2D code provided by Apple in the old sample Lunar Lander.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server