Closed igorkravchenko closed 2 months ago
Hi! Sorry for late answer.
It seems like we should try to remove AS_SWIFT_CLASS
macro and try to use default C++ interop. I used that macro a long time ago, when C++ interop was in experimental mode, maybe in Swift 5.9 all troubles was resolved, but I 'm not sure about it...
@igorkravchenko Hi!
I have updated box2d and now it full compatible to use in Swift project.
You can check it here: AdaEngine PhysicsWorld2D.swift
If you have any question, please reopen issue.
Hi! First of all thanks for this great Swift/C++ interoperability example.
It seems that right now there's no way to create instance of
b2World
(and other C++ classes) in Swift. Most likely this is related toimport_as_ref
attribute. If this attribute is omitted, thenb2World.init(_ gravity: b2Vec2)
gets synthesized, butb2World
is no longer a class but struct. Is there a way to enforce initializer synthesis for C++ classes while still keeping them as reference?