New Function Request

Hi iarwain,
I need to set the solid state of an body shape at runtime. Can you create such a function in the API?

Another thing is that I've created a function that returns the orthogonal vector (clockwise) of a given vector. This is useful in my game and I wonder if you'd like to include it in the API.

Thanks.

Here it goes.
static orxINLINE orxVECTOR* orxVector_Orthogonal( orxVECTOR* _pvRes, const orxVECTOR *_pvOp )
{
	orxASSERT(_pvRes != orxNULL);
	orxASSERT(_pvOp != orxNULL);

	_pvRes->fX = _pvOp->fY;
	_pvRes->fY = -_pvOp->fX;
	_pvRes->fZ = _pvOp->fZ;

	return _pvRes;

}

Comments

  • edited December 2011
    Hi Peso!

    I can add the solid state accessor but it's likely going to delete and recreate the shape behind the scene as I don't think Box2D allows this kind of change itself. I'll look into it though and do for the best. I'm on vacation however so I don't know if I'll have access to a computer before coming back so it might not be done for a couple of weeks.

    As gor the orthogonal function, no problem, I'll add it but will probably add a "2D" somewhere in its name. :)

    Thanks for the suggestion!
  • edited December 2011
    iarwain wrote:
    Hi Peso!

    I can add the solid state accessor but it's likely going to delete and recreate the shape behind the scene as I don't think Box2D allows this kind of change itself. I'll look into it though and do for the best.
    Humm! I see. Well, I think it won't be a big problem.
    I'm on vacation however so I don't know if I'll have access to a computer before coming back so it might not be done for a couple of weeks.
    Ok, no problem.
    As for the orthogonal function, no problem, I'll add it but will probably add a "2D" somewhere in its name. :)
    Do whatever you think will be better for the engine and I will adapt my code.
    Thanks for the suggestion!
    You're welcome.
  • edited December 2011
    Done and done!

    Actually the first one should alter the parts without having to delete/re-create them and for the second one I added PI/2 & -PI/2 as special optimized cases of orxVector_2DRotate() instead of adding a separate function.
  • edited December 2011
    Hi iarwain,
    good news! Thanks.
Sign In or Register to comment.