Switch to mostly returning objects instead of pointers since

almost all objects contain only one pointer inside, making them
very small, so no point paying (de)allocation costs.

This has also been done to physx-c
This commit is contained in:
bloeys
2022-12-19 00:43:04 +04:00
parent 96c55ad30d
commit a01e4b6bbd
22 changed files with 221 additions and 177 deletions

View File

@ -21,8 +21,8 @@ extern "C" {
/// <param name="CPxTolerancesScale"></param>
/// <returns></returns>
CPxAPI CSTRUCT CPxSceneDesc NewCPxSceneDesc(CSTRUCT CPxTolerancesScale);
CPxAPI void CPxSceneDesc_set_gravity(CSTRUCT CPxSceneDesc*, CSTRUCT CPxVec3);
CPxAPI void CPxSceneDesc_set_cpuDispatcher(CSTRUCT CPxSceneDesc*, CSTRUCT CPxCpuDispatcher*);
CPxAPI void CPxSceneDesc_set_gravity(CSTRUCT CPxSceneDesc, CSTRUCT CPxVec3);
CPxAPI void CPxSceneDesc_set_cpuDispatcher(CSTRUCT CPxSceneDesc, CSTRUCT CPxCpuDispatcher);
//CPxSceneDesc_set_onContactCallback sets the contact callback handler of the given scene descriptor.
@ -30,8 +30,8 @@ extern "C" {
//Therefore, the callback handler MUST copy data it wishes to keep for longer than the lifetime of the callback handler, as the memory it was handed might be reused/freed.
//
//NOTE: This function assumes you are using the default physx-c callback handler. Do NOT use this function if you set 'sceneDesc->simulationEventCallback' with your own custom implementation.
CPxAPI void CPxSceneDesc_set_onContactCallback(CSTRUCT CPxSceneDesc*, CPxonContactCallback cb);
CPxAPI void FreeCPxSceneDesc(CSTRUCT CPxSceneDesc*);
CPxAPI void CPxSceneDesc_set_onContactCallback(CSTRUCT CPxSceneDesc, CPxonContactCallback cb);
CPxAPI void FreeCPxSceneDesc(CSTRUCT CPxSceneDesc);
#ifdef __cplusplus
}