General

Reply

Member

Member
DaWolfgang
Posts: 3
Registered: ‎25-04-2012
Message 1 of 6 (257 Views)

Box2CS

Hi,

 

I want to use Box2D physics engine for my game. Box2D is not written in C# but there are some ports available. Box2DX is outdated (no Fixtures etc.) and Farseers Physics Engine seems to be slow (http://community.eu.playstation.com/t5/General/Physics2d-is-limited/m-p/15978235/highlight/true#M104...).

 

Then I found Box2CS (http://code.google.com/p/box2c/). It's a wrapper around the original C++ Box2D. Sounds good: Fast and up to date.

But as soon as I try to create a new World ( mWorld = new World(gravity, true); ) I get the following exception:

 

System.MethodAccessException: Attempt to access a private/protected method failed.
  at System.Security.SecurityManager.ThrowException (System.Exception ex) [0x00000] in <filename unknown>:0

  at (wrapper managed-to-native) Box2CS.World/NativeMethods:b2world_constructor (Box2CS.Vec2,bool)

  at Box2CS.World..ctor (Vec2 gravity, Boolean doSleep) [0x00000] in <filename unknown>:0

Does anyone now what I could do to get Box2CS work?

 

Thanks,

Wolfgang

Please use plain text.

Re: Box2CS

Thats the problem, you can't invoke native code, so a wrapper around a C++ library simply isn't going to work.  

 

 

Try this one ( http://code.google.com/p/box2dx/ ), it appears to be a pure C# implementation.

 

Download it, compile it as a PS Suite library and see how that goes.

Please use plain text.

Member

Member
DaWolfgang
Posts: 3
Registered: ‎25-04-2012
Message 3 of 6 (240 Views)

Re: Box2CS

Thanks for your answere. I already have tried Box2DX. Unfortunately it's an old version (no Fixtures, no kinematic bodies). I will give Box2D.XNA an(other) try.

Please use plain text.

Re: Box2CS

Actually I did some testing and Box2dx uses unsafe code anyways, which will compile on PSS but not run.

Please use plain text.

Re: Box2CS

which unsafe code u refering to?

Join the IRC Chatroom at:

Server: freenode
room: #psm-dev
Veharlek
Blog
Dan
Please use plain text.

Re: Box2CS

I forget specifically , there were 5 or 6 methods tagged unsafe. It would probably be trivial to rewrite those methods. When I say unsafe I mean marked with the keyword unsafe.
Please use plain text.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。