Fixing issues (#94)

- option to draw kinematic shapes with transparency
- slight change to triangle vs hull to reduce ghost collisions
- changed return of b3DebugDraw.DrawShapeFcn to void
#66 
#48 
#69 
#75 
#76
This commit is contained in:
Erin Catto 2026-07-19 21:43:43 -07:00 • committed by GitHub
commit dfa5e6add0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 906 additions and 433 deletions

View file

@ -60,7 +60,7 @@ struct SampleContext
int subStepCount = 4;
int workerCount = 1;
bool transparentDynamic = false;
bool transparent = false;
bool transparentKinematic = false;
bool enableWarmStarting = true;
bool enableContinuous = true;
bool enableSleep = true;
@ -278,47 +278,3 @@ struct CastClosestContext
float CastClosestCallback( b3ShapeId shapeId, b3Pos point, b3Vec3 normal, float fraction, uint64_t materialId, int triangleIndex,
int childIndex, void* context );
struct MoverShapeUserData
{
float maxPush;
bool clipVelocity;
};
struct PlaneExtra
{
b3Pos point;
b3ShapeId shapeId;
};
struct CharacterMover
{
static constexpr int m_planeCapacity = 8;
static constexpr float m_jumpSpeed = 5.0f;
static constexpr float m_maxSpeed = 6.0f;
static constexpr float m_minSpeed = 0.01f;
static constexpr float m_stopSpeed = 1.0f;
static constexpr float m_accelerate = 30.0f;
static constexpr float m_friction = 4.0f;
static constexpr float m_gravity = 15.0f;
void Initialize( Sample* sample, b3Pos position );
void SolveMove( float timeStep, b3Vec3 forward, b3Vec3 right, b3Vec2 throttle, bool clipVelocity );
void Step( b3ShapeId* ignoreShapes, int ignoreCount, bool clipVelocity );
Sample* m_sample;
b3WorldTransform m_transform;
b3Vec3 m_velocity;
b3Capsule m_capsule;
b3CollisionPlane m_planes[m_planeCapacity] = {};
PlaneExtra m_planeExtras[m_planeCapacity] = {};
int m_planeCount;
int m_totalIterations;
float m_pogoVelocity;
bool m_onGround;
bool m_sprint;
// Transient
b3ShapeId* m_ignoreShapeIds;
int m_ignoreCount;
};