29#ifndef DY_FRICTION_PATCH_STREAM_PAIR_H
30#define DY_FRICTION_PATCH_STREAM_PAIR_H
32#include "foundation/PxSimpleTypes.h"
34#include "foundation/PxMutex.h"
35#include "foundation/PxArray.h"
51#include "PxcNpMemBlockPool.h"
62 template<
class FrictionPatch>
63 FrictionPatch* reserve(
const PxU32 size);
65 template<
class FrictionPatch>
66 const FrictionPatch* findInputPatches(
const PxU8* ptr)
const;
79 mBlockPool(blockPool), mBlock(NULL), mUsed(0)
90template <
class FrictionPatch>
91FrictionPatch* FrictionPatchStreamPair::reserve(
const PxU32 size)
93 if(size>PxcNpMemBlock::SIZE)
95 return reinterpret_cast<FrictionPatch*
>(-1);
98 PX_ASSERT(size <= PxcNpMemBlock::SIZE);
100 FrictionPatch* ptr = NULL;
102 if(mBlock == NULL || mUsed + size > PxcNpMemBlock::SIZE)
104 mBlock = mBlockPool.acquireFrictionBlock();
110 ptr =
reinterpret_cast<FrictionPatch*
>(mBlock->data+mUsed);
117template <
class FrictionPatch>
118const FrictionPatch* FrictionPatchStreamPair::findInputPatches(
const PxU8* ptr)
const
120 return reinterpret_cast<const FrictionPatch*
>(ptr);
Definition DyFrictionPatchStreamPair.h:57
Definition PxcNpMemBlockPool.h:52
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition PxcNpMemBlockPool.h:41