Coder Social home page Coder Social logo

rust_box2d's People

Contributors

bastacyclop avatar gohla avatar norru avatar sbeca avatar schmidmt avatar snowsignal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rust_box2d's Issues

Error when getting position of CircleShape

Hello, found this issue when I were playing with shapes and getting it position.
For start I were using b2::CircleShape::new without passing Vec2 and radius, which I thought was a problem of crash, but once I used new_with() with Vec2 and radius, nothing changes. I have feeling that problem with getting position of CircleShape itself.

Error: process didn't exit successfully: 'target\debug\examples\samples.exe' (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

Example:

let test_circle_shape = b2::CircleShape::new_with(b2::Vec2{x: -3., y: 0.}, 3.0);
test_circle_shape.position();

You might run it and it will crash immediately.

The lack of documentation is a real hinderance

Hi, this code seems to have taken quite some effort, which is why I'm surprised that it's almost completely undocumented. By that I mean only source code is provided, even the official documentation is just source code with a search bar, no doc comments.

As a new user, this makes it extremely hard to use: things that could otherwise take a minute can take upwards of an hour (not to mention the possibility of something not even being supported).

I know this is supposed to be a thin wrapper around Box2D, however the difference is still large enough to cause confusion and necessitate documenting the edge cases.

Of course, for example, the step function or the idea of fixtures don't have to be documented. But how UserDataTypes are used and hundreds of other such things induced by the language difference totally require explanation.

Functions returning structs do not work

Structs defined in c++, such as b2Vec2 seem to cause many problems when they are passed over the FFI by-value. I think the reason is different calling conventions for C vs C++.
It seems like functions returning structs as-value or taking structs as input argument as-value cause problems. Take Body::world_point() as example, it does not work and return undefined data or some times crash. (All other demos from the testbed work because they never use any such function).

It is implemented as follows:

pub fn world_point(&self, local: &Vec2) -> Vec2 {
        unsafe { ffi::Body_get_world_point(self.ptr(), local) }
    }
b2Vec2 Body_get_world_point(const b2Body* self, const b2Vec2* local) {
    return self->GetWorldPoint(*local);
}

Here the argument "local" will point to garbage no matter how you call the funcition and the program crashes. This is because the return value is a b2Vec2 as-value and b2Vec2 is compiled as struct/class by c++ code while the function Body_get_world_point is treated as C-code.

suggestion: no_std support

Hey, I'd like to use this to make playdate games, but that would require no_std support. It would be great to be able to use this on platforms and devices that don't have access to the standard library.

I see there is a dependency on nalgebra, I belive that weould need default features disabling, not sure about the other dependecies.

Where are the Box2D files expected to be? What files are expected?

As someone with no C++ experience this has been rather confusing... what exactly is expected of the Box2D dependency regards its location and its contents? I've tried pointing to it locally w/ BOX2D_INCLUDE_PATH as well as putting what I think are the correct Box2D contents in /usr/local/include/ to no avail. Help appreciated :-)

macOS, Rust 1.21.0

Travis is not running

It looks like the Travis CI is not running on new commits anymore .. this needs to be investigated.

Docs for UserData

Hi,

thanks for this awsome bindings.

Is there any documentation on how to user UserData?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.