Skip to content

shape_collide and body_collide_shape from IPhysicsServer2DExtension gives compilation error #677

Closed
@Ughuuu

Description

@Ughuuu

The following 2 functions:

#[godot_api]
impl IPhysicsServer2DExtension for RapierPhysicsServer2D {
...
    unsafe fn shape_collide(&mut self, shape_A: Rid, xform_A: Transform2D, motion_A: Vector2, shape_B: Rid, xform_B: Transform2D, motion_B: Vector2, results: * mut c_void, result_max: i32, result_count: * mut i32,) -> bool {
        false
    }

    unsafe fn body_collide_shape(&mut self, body: Rid, body_shape: i32, shape: Rid, shape_xform: Transform2D, motion: Vector2, results: * mut c_void, result_max: i32, result_count: * mut i32,) -> bool {
    }
...
}

When implemented to a IPhysicsServer2DExtension gives the following error:

17 | #[godot_api]
   | ^^^^^^^^^^^^ the trait `ToGodot` is not implemented for `*mut i32`, which is required by `(bool, godot::prelude::Rid, godot::prelude::Transform2D, godot::prelude::Vector2, godot::prelude::Rid, godot::prelude::Transform2D, godot::prelude::Vector2, *mut c_void, i32, *mut i32): PtrcallSignatureTuple`
   |
   = help: the trait `ToGodot` is implemented for `i32`
   = note: required for `(bool, Rid, Transform2D, Vector2, Rid, Transform2D, Vector2, *mut c_void, i32, *mut i32)` to implement `PtrcallSignatureTuple`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugc: registerRegister classes, functions and other symbols to GDScript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions