Last night, I was looking for a 3D physics engine for Monogame and I reached BEPUphysics.
BEPUphysics is a 3D physics library by BEPU. It’s fast and has a bunch of cool features like constraints, terrain, static and instanced meshes, continuous collision detection, custom collision rules, vehicles, easy multithreading, yadda yadda yadda. Full support for XBox360 and WP7 too!
Investigating BEPU website, I found that there's a work in progress version of BEPUPhysics for Monogame (the clue was a one blog post called "BEPUPhisics and XNA" and said The most likely target frameworks for the rewritten demos will be either SharpDX or, for wider use, MonoGame.) and also a twitt form the BEPUPhysics that said "The new demos application is indeed almost certainly going to be MonoGame based"
So I decided to take a look at BEPU source code repository and community-contributed forks.
I saw a monogame fork of BEPUphysics at http://bepuphysics.codeplex.com/SourceControl/network/forks/StephenOC/MonoGame and quickly download it, but my surprise was when I found that It's a windows version of BEPUphysics. But I far as I know I read it's posible running BEPUphysics on Monogame so I decided to try.
First, I openned Visual Studio and create a Windows class library. Then, I references Monogame Dll (to this test I use Windows OpenGL version) and put all BEPUphysics classes. Dont forget to set your project build propertis symbols to WINDOWS;ALLOWUNSAFE;CHECKMATH;MONOGAME
After a few build trys and removing some unuseful files, my build was succesful!
Then I create a Monogame Windows OpenGL game to test the BlocksExplodeYourCastle BEPU Demo game and I (almost) everything works out of the box! I say almost because the Monogame version of BlocksExplodeYourCastle was a lot of slower then XNA Version, but that's another history.
Also, I found a monogame build on the Monogame brach of PloobsEngine (https://code.google.com/p/port-ploobsengine/source/browse/PloobsEngine/PloobsEngine/Dlls/BEPUphysics.dll?name=MonoReach), but the BlocksExplodeYourCastle monogame version is still slow.
PS: I just run BlocksExplodeYourCastle monogame version and It runs at an acceptable speed! so I just need to make some more tests
Esfuerzo Por Agregar Valor, No Por Ser Perfecto! Strive For Adding Value, Not Being Perfect!
Mostrando las entradas con la etiqueta port. Mostrar todas las entradas
Mostrando las entradas con la etiqueta port. Mostrar todas las entradas
ImageCropper for iOs c# monotouch version
I have ported the excellent ImageCropper for iOs control from Objective C to C# Monotouch
ImageCropper for iOs is a drop-in image cropper for iOS (as seen in Photos app, UIImagePickerController)
I like this controle because it's so so simply and it shows images like iPhone Photos app (and I was looking for any sample!)
As always, you can download source source from https://bitbucket.org/hzaldivar/imagecroppersharp
I made a PhotoAlbumViewController based on this control and Escoz's PagedViewController. I'll upload source code soon!
A new (and better) PopOver port than FPPopover to c# Xamarion Monotouch iOs
Here you have my new (and better) PopOver port from Objective C to c# Xamarion Monotouch iOs than FPPopover.
I started a new port because my last popover port was so buggy and not so beautiful like this! You can find it here: https://bitbucket.org/hzaldivar/popoverviewsharp/
I started a new port because my last popover port was so buggy and not so beautiful like this! You can find it here: https://bitbucket.org/hzaldivar/popoverviewsharp/
Use it to display:
- Single String
- Multiple Strings
- Single UIView
- Multiple UIViews
- All Above + Titles
You can find the original popOver at http://blog.getsherpa.com/blog/2012/09/14/popoverview-a-flexible-modal-content-view-for-ios/ with usage information and more samples. It's really easy and awesome!
Drop me a line or follow me:
https://twitter.com/vackup
Please support my work by downloading my game "A comic of zombies" starring Obama and visting ad banners! Thanks!
A Comic of Zombies for iOs
- Paid: http://itunes.apple.com/us/app/a-comic-of-zombies/id530916013?mt=8
- Free: http://itunes.apple.com/us/app/comic-zombies-free-ad-suported/id541816638?mt=8
A Comic of Zombies for PC
Last but not least, here you have the articles I found useful while porting
NSArray
The MonoTouch runtime automatically takes care of converting C# arrays to NSArrays and doing the conversion back,.The idea is to use a strongly typed C# array as this will allow the IDE to provide proper code completion with the actual type without forcing the user to guess, or look up the documentation to find out the actual type of the objects contained in the array.
In cases where you can not track down the actual most derived type contained in the array, you can use NSObject [] as the return value.
http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types#Arrays
If you go to the MonoTouch API Design page and do an in-page search for "NSArray", you'll find this: Instead of dealing with NSString and NSArray the runtime instead exposes these as C# strings and strongly typed arrays throughout the API.
http://stackoverflow.com/questions/1855478/using-nsarray-with-monotouch
MonoTouch: Where is Frame.Origin?
http://stackoverflow.com/questions/8826697/monotouch-where-is-frame-originWhat's the point of NSAssert, actually?
Assert is to make sure a value is what its suppose to be. If assertion fails that means something went wrong and so the app quitshttp://stackoverflow.com/questions/1375786/whats-the-point-of-nsassert-actually
Using UIGestureRecognizer in MonoTouch
Using selector
http://dan.clarke.name/2012/08/using-uigesturerecognizer-in-monotouch/http://docs.xamarin.com/index.php?title=ios/recipes/content_controls/scroll_view/implement_tap-to-zoom&action=source
Using lambda expression
http://monotouch.2284126.n4.nabble.com/UITapGestureRecognizer-can-t-get-to-work-td4656380.htmlhttps://github.com/xamarin/monotouch-samples/blob/master/Touch/Screens/iPhone/GestureRecognizers/GestureRecognizers_iPhone.xib.cs
Animate Using Blocks
http://docs.xamarin.com/ios/recipes/Animation/CoreAnimation/Animate_Using_BlocksrespondsToSelector - Delegates
http://monotouch.2284126.n4.nabble.com/respondsToSelector-td3536741.htmlUIBezierPath
http://es.scribd.com/doc/53062638/88/UIBezierPathhttp://docs.xamarin.com/ios/Guides/Advanced_Topics/Binding_Objective-C_Libraries
http://iosapi.xamarin.com/index.aspx?link=M%3AMonoTouch.UIKit.UIColor.SetFill()
Private methods
http://macdevelopertips.com/objective-c/private-methods.htmlhttp://stackoverflow.com/questions/2158660/why-doesnt-objective-c-support-private-methods
Introduction to Objective C
http://blog.teamtreehouse.com/an-introduction-to-objective-c+ static (class) methods
- normal (instance) methods
Rounding up the corners of a UIView, Monotouch c# version
Today I needed to round some corners of an UIView in an app I'm developing and I remember a great article from our friends of Infinixsoft at http://infinixsoft.com/2012/09/rounding-up-the-corners-of-a-uiview/
But, as I'm a Monotouch c# developer and the article was written in objetive C here's the port:
using MonoTouch.UIKit;
using MonoTouch.CoreAnimation;
using System.Drawing;
public static class Utils
{
public static void RoundView(this UIView self, UIRectCorner rectCorner, float radius)
{
var maskPath = UIBezierPath.FromRoundedRect(self.Bounds, rectCorner, new SizeF(radius, radius));
var maskLayer = new CAShapeLayer();
maskLayer.Frame = self.Bounds;
maskLayer.Path = maskPath.CGPath;
self.Layer.Mask = maskLayer;
maskLayer.Dispose();
}
}
I developed it as static extension method of UIView, so to use it just (for eg)
NavigationController.NavigationBar.RoundView(UIRectCorner.TopLeft | UIRectCorner.TopRight, 5.0f);
Enjoy it!
https://twitter.com/vackup
But, as I'm a Monotouch c# developer and the article was written in objetive C here's the port:
using MonoTouch.UIKit;
using MonoTouch.CoreAnimation;
using System.Drawing;
public static class Utils
{
public static void RoundView(this UIView self, UIRectCorner rectCorner, float radius)
{
var maskPath = UIBezierPath.FromRoundedRect(self.Bounds, rectCorner, new SizeF(radius, radius));
var maskLayer = new CAShapeLayer();
maskLayer.Frame = self.Bounds;
maskLayer.Path = maskPath.CGPath;
self.Layer.Mask = maskLayer;
maskLayer.Dispose();
}
}
I developed it as static extension method of UIView, so to use it just (for eg)
NavigationController.NavigationBar.RoundView(UIRectCorner.TopLeft | UIRectCorner.TopRight, 5.0f);
Enjoy it!
https://twitter.com/vackup
FPPopover, iPad-like popovers for iPhone ported to Xamarin Monotouch
Important information!! I have a new (and better) PopOver port to c# monotouch, that is more beautiful and works better. Go to http://vackup.blogspot.com.ar/2012/11/a-new-and-better-popover-port-to-c.html
You can download source code from https://bitbucket.org/hzaldivar/fppopoversharp (and also a sample app)
Follow me: https://twitter.com/vackup
Help me, downloading my game "A comic of zombies" starring Obama, thanks!:
I'm a c# developer and now I'm developing iphone apps so I use Monotouch (http://xamarin.com/monotouch/).
In an app I'm developing, I need a Popover for iphone but browsing the web I realize Apple's Popover doesn't work with iPhone (only iPad).
I found several popovers that work with iPhone and the best one is FPPopover from 50Pixels and it's open source source!!
FPPopover is an alternative to the native iOS UIPopoverController, adding support for iPhone and additional opportunities to customize the look and feel of the popovers.
Features
- Works like UIPopoverController.
- Runs on both iPhone and iPad.
- Popover rendered using no images, only Quartz code.
- Customize the look of popovers (color, dimensions).
- Automatic orientation. It will find the best orientation and size for every situation.
- MIT License (you can use it for commercial apps, edit and redistribute).
FPPopover is written in Objective C as every popover I found :( and I don't have any experience with Objective C and Xcode
Binding Objective C popover (http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types) was a really mess and hard to debug so I decided to port it to c# and after a week fighting (and learning) with objective-c I finally and successfully ported @50pixels FPPopover to c#.
These are the links I found useful in my path of porting (and also learning) objective C
- http://razum.si/automagical/buy
- http://adventuresdotnet.blogspot.com.ar/2012/05/translating-objective-c-to-c-part-1-of.html
- http://www.knowing.net/index.php/monotouch-custom-viewcontroller-adding-stepwise-subviews/
- https://github.com/mono/maccore/tree/master/src/CoreGraphics
- http://stackoverflow.com/questions/7899415/monotouch-set-position-from-subview
I have a couple of things to mention:
- RectangleF.Inflate(); use negative values!!!
- Like C, objective C objects don't need to be initialize before access them. In c# you get a NullReferenceException
- RectangleF is a value-type (struct), not a reference type. You cannot change their properties / fields in .NET without creating a new instance (directly or indirectly);
You can download source code from https://bitbucket.org/hzaldivar/fppopoversharp (and also a sample app)
Follow me: https://twitter.com/vackup
Help me, downloading my game "A comic of zombies" starring Obama, thanks!:
- Paid: http://itunes.apple.com/us/app/a-comic-of-zombies/id530916013?mt=8
- Free: http://itunes.apple.com/us/app/comic-zombies-free-ad-suported/id541816638?mt=8
Suscribirse a:
Entradas (Atom)
+21.10.12.png)
+21.10.19.png)
+17.07.27.png)
+17.14.02.png)
