xamarin / urho

Code to integrate with the Urho3D engine
Other
464 stars 122 forks source link

New API-method in Urho3D #354

Open esakylli opened 5 years ago

esakylli commented 5 years ago

@EgorBo: While you are working with .NET Standard support, could you add this new API-method to the forked Urho3D-version that UrhoSharp uses? ... and then run the binding-tool to get it generated to the C# side ... The code-snippet is for Bullet Physics. I have tested it successfully.

I would really need this in my game. It would make my day :-) (I would do a PR myself if my git-skills were better...)

Constraint.h

public:
    float GetHingeAngle() const;

Constraint.cpp

float Constraint::GetHingeAngle() const
{
    if (!constraint_)
        return 0.0f;

    if (constraint_->getConstraintType() != HINGE_CONSTRAINT_TYPE)
        return 0.0f;

    btHingeConstraint* hingeConstraint = static_cast<btHingeConstraint*>(constraint_.Get());
    return hingeConstraint->getHingeAngle() * M_RADTODEG;
}
EgorBo commented 5 years ago

@esakylli I can add this specific method but I am not sure I can easily re-run the binder on top of HEAD of Urho3D (mostly because of changes in SDL)

esakylli commented 5 years ago

@EgorBo But isn't UrhoSharp using a forked version of Urho3D (from 2017)?