33void physics3d_init(
float gx,
float gy,
float gz, uint32_t maxBodies);
43int physics3d_raycastAll(
float ox,
float oy,
float oz,
float dx,
float dy,
float dz, uint32_t layerMask, uint32_t maxHits);
47 uint32_t layerMask, uint32_t flags);
51 float bounceThreshold);
55 float px,
float py,
float pz,
float qx,
float qy,
float qz,
float qw,
56 int motion,
float gravityScale,
float linearDamping,
float angularDamping,
57 int fixedRotation, uint32_t layer,
int continuous,
58 float friction,
float restitution,
int isSensor,
float mass);
60 float px,
float py,
float pz,
61 float qx,
float qy,
float qz,
float qw,
62 int motion,
float gravityScale,
float linearDamping,
63 float angularDamping,
int fixedRotation, uint32_t layer,
64 int continuous,
float friction,
float restitution,
int isSensor,
65 float cx,
float cy,
float cz);
67 float px,
float py,
float pz,
68 float qx,
float qy,
float qz,
float qw,
69 int motion,
float gravityScale,
float linearDamping,
70 float angularDamping,
int fixedRotation, uint32_t layer,
71 int continuous,
float friction,
float restitution,
int isSensor,
72 float cx,
float cy,
float cz);
74 float px,
float py,
float pz,
75 float qx,
float qy,
float qz,
float qw,
76 int motion,
float gravityScale,
float linearDamping,
77 float angularDamping,
int fixedRotation, uint32_t layer,
78 int continuous,
float friction,
float restitution,
int isSensor,
79 float cx,
float cy,
float cz);
81 uintptr_t indexPtr, uint32_t indexCount,
82 float px,
float py,
float pz,
83 float qx,
float qy,
float qz,
float qw,
84 uint32_t layer,
float friction,
float restitution);
86 float px,
float py,
float pz,
87 float qx,
float qy,
float qz,
float qw,
88 int motion,
float gravityScale,
float linearDamping,
89 float angularDamping,
int fixedRotation, uint32_t layer,
90 int continuous,
float friction,
float restitution,
int isSensor);
93 float qx,
float qy,
float qz,
float qw);
101void physics3d_addImpulse(uint32_t bodyId,
float ix,
float iy,
float iz,
float px,
float py,
float pz);
120void physics3d_addForce(uint32_t bodyId,
float fx,
float fy,
float fz,
float px,
float py,
float pz);
125 float px,
float py,
float pz,
float maxSlope,
float mass,
126 uint32_t layer,
float pushForce);
129 float dt,
float stepUp,
float stepDown);
134 float px,
float py,
float pz,
float ax,
float ay,
float az,
135 float nx,
float ny,
float nz,
float normalHalf,
float planeHalf,
136 float twistMin,
float twistMax,
int collideConnected);
138 float px,
float py,
float pz,
float ax,
float ay,
float az,
float nx,
float ny,
float nz,
139 int translationMotion,
int rotationMotion,
140 float lx,
float ly,
float lz,
float hx,
float hy,
float hz,
141 float rx,
float ry,
float rz,
float sx,
float sy,
float sz,
int collideConnected);
143 float vx,
float vy,
float vz,
float wx,
float wy,
float wz,
float maxForce,
float maxTorque);
145 float px,
float py,
float pz,
int collideConnected);
147 float px,
float py,
float pz,
148 float ax,
float ay,
float az,
149 int enableLimit,
float lowerAngle,
float upperAngle,
150 int enableMotor,
float motorSpeed,
float maxTorque,
151 int collideConnected);
153 float px,
float py,
float pz,
154 float ax,
float ay,
float az,
155 int enableLimit,
float lower,
float upper,
156 int enableMotor,
float motorSpeed,
float maxForce,
157 int collideConnected);
159 float ax,
float ay,
float az,
160 float bx,
float by,
float bz,
161 float minLength,
float maxLength,
162 float frequency,
float damping,
int collideConnected);
164 int collideConnected);
185 float qx,
float qy,
float qz,
float qw,
float dx,
float dy,
float dz, uint32_t layerMask);
188 float qx,
float qy,
float qz,
float qw,
float dx,
float dy,
float dz, uint32_t layerMask);
190 float dx,
float dy,
float dz, uint32_t layerMask);
void physics3d_setSolver(int velocityIterations, int positionIterations, int allowSleep, float bounceThreshold)
uint32_t physics3d_addBox(uint32_t entity, float hx, float hy, float hz, float px, float py, float pz, float qx, float qy, float qz, float qw, int motion, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, uint32_t layer, int continuous, float friction, float restitution, int isSensor, float cx, float cy, float cz)
int physics3d_overlapBox(float px, float py, float pz, float hx, float hy, float hz, uint32_t layerMask)
The same for a box, given its half-extents.
uintptr_t physics3d_sensorEnters()
int physics3d_raycast(float ox, float oy, float oz, float dx, float dy, float dz, uint32_t layerMask)
size_t physics3d_queryResultBytes()
size_t physics3d_sensorEntersBytes()
void physics3d_addImpulse(uint32_t bodyId, float ix, float iy, float iz, float px, float py, float pz)
void physics3d_removeCharacter(uint32_t characterId)
uintptr_t physics3d_queryResult()
void physics3d_setAwake(uint32_t bodyId, int awake)
uint32_t physics3d_addCapsule(uint32_t entity, float radius, float halfHeight, float px, float py, float pz, float qx, float qy, float qz, float qw, int motion, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, uint32_t layer, int continuous, float friction, float restitution, int isSensor, float cx, float cy, float cz)
int physics3d_raycastAll(float ox, float oy, float oz, float dx, float dy, float dz, uint32_t layerMask, uint32_t maxHits)
uint32_t physics3d_addMeshBody(uint32_t entity, uintptr_t vertexPtr, uint32_t vertexCount, uintptr_t indexPtr, uint32_t indexCount, float px, float py, float pz, float qx, float qy, float qz, float qw, uint32_t layer, float friction, float restitution)
Registers imported geometry as a collider.
size_t physics3d_sensorExitsBytes()
size_t physics3d_contactEnterMassesBytes()
uint32_t physics3d_addConvexBody(uint32_t entity, uintptr_t vertexPtr, uint32_t vertexCount, float px, float py, float pz, float qx, float qy, float qz, float qw, int motion, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, uint32_t layer, int continuous, float friction, float restitution, int isSensor)
Registers the convex hull of imported geometry as a collider.
uintptr_t physics3d_characterHits()
void physics3d_setTransform(uint32_t bodyId, float px, float py, float pz, float qx, float qy, float qz, float qw)
void physics3d_setMass(uint32_t bodyId, float mass)
void physics3d_init(float gx, float gy, float gz, uint32_t maxBodies)
int physics3d_jointForce(uint32_t entity)
size_t physics3d_contactExitsBytes()
uint32_t physics3d_addCompound(uint32_t entity, uintptr_t partsPtr, uint32_t count, float px, float py, float pz, float qx, float qy, float qz, float qw, int motion, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, uint32_t layer, int continuous, float friction, float restitution, int isSensor, float mass)
void physics3d_addForce(uint32_t bodyId, float fx, float fy, float fz, float px, float py, float pz)
void physics3d_shutdown()
uint32_t physics3d_addSixDOFJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, float px, float py, float pz, float ax, float ay, float az, float nx, float ny, float nz, int translationMotion, int rotationMotion, float lx, float ly, float lz, float hx, float hy, float hz, float rx, float ry, float rz, float sx, float sy, float sz, int collideConnected)
Axis motion is packed as two bits per axis: 0 locked, 1 limited, 2 free.
uint32_t physics3d_addSliderJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, float px, float py, float pz, float ax, float ay, float az, int enableLimit, float lower, float upper, int enableMotor, float motorSpeed, float maxForce, int collideConnected)
One axis of travel — a lift, a piston, a sliding door.
size_t physics3d_contactEnterSpeedsBytes()
int physics3d_boxCast(float px, float py, float pz, float hx, float hy, float hz, float qx, float qy, float qz, float qw, float dx, float dy, float dz, uint32_t layerMask)
void physics3d_addTorque(uint32_t bodyId, float tx, float ty, float tz)
A torque of (tx, ty, tz) newton metres, over the next step.
void physics3d_step(float dt, int collisionSteps)
Advance the world, then refill the transform buffer with every active body.
size_t physics3d_contactEntersBytes()
void physics3d_setAdvancedJointMotor(uint32_t entity, int enable, float vx, float vy, float vz, float wx, float wy, float wz, float maxForce, float maxTorque)
Live velocity/force changes do not rebuild the joint or reset its zero pose.
void physics3d_removeBody(uint32_t bodyId)
void physics3d_setDistanceJoint(uint32_t entity, float minLength, float maxLength, float frequency, float damping)
int physics3d_isAwake(uint32_t bodyId)
uint32_t physics3d_addSphere(uint32_t entity, float radius, float px, float py, float pz, float qx, float qy, float qz, float qw, int motion, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, uint32_t layer, int continuous, float friction, float restitution, int isSensor, float cx, float cy, float cz)
uint32_t physics3d_addDistanceJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, float ax, float ay, float az, float bx, float by, float bz, float minLength, float maxLength, float frequency, float damping, int collideConnected)
void physics3d_setCharacterPosition(uint32_t characterId, float px, float py, float pz)
Puts a character somewhere, rather than moving it there.
int physics3d_getBodyDynamics(uint32_t bodyId)
void physics3d_setJointMotor(uint32_t entity, int enable, float speed)
Drive an existing hinge or slider from gameplay, without rebuilding the joint.
void physics3d_moveCharacter(uint32_t characterId, float vx, float vy, float vz, float dt, float stepUp, float stepDown)
uintptr_t physics3d_contactEnters()
uintptr_t physics3d_transforms()
void physics3d_setJointMotorLimit(uint32_t entity, float limit)
int physics3d_getBodyMassData(uint32_t bodyId)
void physics3d_setAngularVelocity(uint32_t bodyId, float wx, float wy, float wz)
int physics3d_overlapSphere(float px, float py, float pz, float radius, uint32_t layerMask)
Everything a sphere at this position overlaps.
uintptr_t physics3d_sensorExits()
size_t physics3d_characterHitsBytes()
int physics3d_getBodyState(uint32_t bodyId)
uintptr_t physics3d_contactEnterSpeeds()
void physics3d_setLinearVelocity(uint32_t bodyId, float vx, float vy, float vz)
int physics3d_raycastWith(float ox, float oy, float oz, float dx, float dy, float dz, uint32_t layerMask, uint32_t flags)
The world's nearest hit, or a character's when one is nearer and flags bit 0 asks for them.
void physics3d_removeJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB)
uint32_t physics3d_addHingeJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, float px, float py, float pz, float ax, float ay, float az, int enableLimit, float lowerAngle, float upperAngle, int enableMotor, float motorSpeed, float maxTorque, int collideConnected)
int physics3d_sphereCast(float px, float py, float pz, float radius, float dx, float dy, float dz, uint32_t layerMask)
void physics3d_addAngularImpulse(uint32_t bodyId, float ix, float iy, float iz)
void physics3d_optimize()
void physics3d_setGravity(float gx, float gy, float gz)
uintptr_t physics3d_contactExits()
uint32_t physics3d_addSwingTwistJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, float px, float py, float pz, float ax, float ay, float az, float nx, float ny, float nz, float normalHalf, float planeHalf, float twistMin, float twistMax, int collideConnected)
Both frames coincide at creation, so limits are relative to the authored pose.
int physics3d_capsuleCast(float px, float py, float pz, float radius, float halfHeight, float qx, float qy, float qz, float qw, float dx, float dy, float dz, uint32_t layerMask)
float physics3d_jointValue(uint32_t entity)
uint32_t physics3d_addPointJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, float px, float py, float pz, int collideConnected)
A shared point, free to turn on all three axes — a chain link, a ragdoll limb.
void physics3d_setLayerMask(uint32_t layer, uint32_t mask)
Declares which layers layer layer collides with.
uint32_t physics3d_addCharacter(uint32_t entity, float radius, float halfHeight, float px, float py, float pz, float maxSlope, float mass, uint32_t layer, float pushForce)
Registers a character: an upright capsule swept against the world.
void physics3d_setJointLimits(uint32_t entity, int enable, float lower, float upper)
uintptr_t physics3d_contactEnterMasses()
uint32_t physics3d_addFixedJoint(uint32_t entity, uint32_t bodyA, uint32_t bodyB, int collideConnected)
No freedom at all: the two move as one, until something breaks them apart.
size_t physics3d_transformsBytes()