|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
The Box2D module's entry points, declared once for both platforms. More...
#include <cstddef>#include <cstdint>

Go to the source code of this file.
Functions | |
| void | physics_init (float gx, float gy, float timestep, int substeps, float contactHertz, float contactDampingRatio, float contactSpeed) |
| void | physics_setWorldConfig (int enableSleep, int enableContinuous, float restitutionThreshold, float maxLinearSpeed) |
| void | physics_shutdown () |
| void | physics_setOneWayPlatform (uint32_t entityId, float nx, float ny, int enable) |
| void | physics_setOneWayPlatformLocal (uint32_t entityId, float nx, float ny, int enable) |
| void | physics_createBody (uint32_t entityId, int bodyType, float x, float y, float angle, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, int bullet) |
| void | physics_destroyBody (uint32_t entityId) |
| int | physics_hasBody (uint32_t entityId) |
| void | physics_setBodyEnabled (uint32_t entityId, int enabled) |
| void | physics_step (float dt) |
| void | physics_setBodyTransform (uint32_t entityId, float x, float y, float angle) |
| int | physics_setBodyTransforms (uintptr_t bufferPtr, int count, float ppu) |
| void | physics_setBodyTargetTransform (uint32_t entityId, float x, float y, float angle, float dt) |
| int | physics_getDynamicBodyCount () |
| int | physics_getBodyCount () |
| int | physics_getShapeCount () |
| int | physics_getJointCount () |
| int | physics_getTrackingRows () |
| uintptr_t | physics_getDynamicBodyTransforms () |
| void | physics_capturePoses () |
| int | physics_getInterpolatedCount () |
| uintptr_t | physics_getInterpolatedTransforms (float alpha) |
| void | physics_collectEvents () |
| int | physics_getCollisionEnterCount () |
| uintptr_t | physics_getCollisionEnterBuffer () |
| int | physics_getHitEventCount () |
| uintptr_t | physics_getHitEventBuffer () |
| int | physics_getCollisionExitCount () |
| uintptr_t | physics_getCollisionExitBuffer () |
| int | physics_getSensorEnterCount () |
| uintptr_t | physics_getSensorEnterBuffer () |
| int | physics_getSensorExitCount () |
| uintptr_t | physics_getSensorExitBuffer () |
| void | physics_applyForce (uint32_t entityId, float forceX, float forceY) |
| void | physics_applyImpulse (uint32_t entityId, float impulseX, float impulseY) |
| void | physics_setLinearVelocity (uint32_t entityId, float vx, float vy) |
| uintptr_t | physics_getLinearVelocity (uint32_t entityId) |
| void | physics_setGravity (float gx, float gy) |
| uintptr_t | physics_getGravity () |
| void | physics_setAngularVelocity (uint32_t entityId, float omega) |
| float | physics_getAngularVelocity (uint32_t entityId) |
| void | physics_applyTorque (uint32_t entityId, float torque) |
| void | physics_applyAngularImpulse (uint32_t entityId, float impulse) |
| void | physics_updateBodyProperties (uint32_t entityId, int bodyType, float gravityScale, float linearDamping, float angularDamping, int fixedRotation, int bullet) |
| void | physics_setAwake (uint32_t entityId, int awake) |
| int | physics_isAwake (uint32_t entityId) |
| float | physics_getBodyMass (uint32_t entityId) |
| float | physics_getBodyInertia (uint32_t entityId) |
| uintptr_t | physics_getBodyCenterOfMass (uint32_t entityId) |
| void | physics_addBoxShape (uint32_t entityId, float halfW, float halfH, float offX, float offY, float radius, float density, float friction, float restitution, int isSensor, uint32_t categoryBits, uint32_t maskBits) |
| void | physics_addCircleShape (uint32_t entityId, float radius, float offX, float offY, float density, float friction, float restitution, int isSensor, uint32_t categoryBits, uint32_t maskBits) |
| void | physics_addCapsuleShape (uint32_t entityId, float radius, float halfHeight, float offX, float offY, float density, float friction, float restitution, int isSensor, uint32_t categoryBits, uint32_t maskBits) |
| void | physics_addSegmentShape (uint32_t entityId, float x1, float y1, float x2, float y2, float density, float friction, float restitution, int isSensor, uint32_t categoryBits, uint32_t maskBits) |
| void | physics_addPolygonShape (uint32_t entityId, uintptr_t verticesPtr, int vertexCount, float radius, float density, float friction, float restitution, int isSensor, uint32_t categoryBits, uint32_t maskBits) |
| void | physics_addChainShape (uint32_t entityId, uintptr_t pointsPtr, int pointCount, int isLoop, float friction, float restitution, uint32_t categoryBits, uint32_t maskBits) |
| void | physics_clearShapes (uint32_t entityId) |
| int | physics_createRevoluteJoint (uint32_t entityIdA, uint32_t entityIdB, float anchorAx, float anchorAy, float anchorBx, float anchorBy, int enableMotor, float motorSpeed, float maxMotorTorque, int enableLimit, float lowerAngle, float upperAngle, int collideConnected) |
| void | physics_destroyJoint (uint32_t entityId) |
| void | physics_setRevoluteMotorSpeed (uint32_t entityId, float speed) |
| void | physics_setRevoluteMaxMotorTorque (uint32_t entityId, float torque) |
| void | physics_enableRevoluteMotor (uint32_t entityId, int enable) |
| void | physics_enableRevoluteLimit (uint32_t entityId, int enable) |
| void | physics_setRevoluteLimits (uint32_t entityId, float lower, float upper) |
| float | physics_getRevoluteAngle (uint32_t entityId) |
| float | physics_getRevoluteMotorTorque (uint32_t entityId) |
| int | physics_hasJoint (uint32_t entityId) |
| int | physics_createDistanceJoint (uint32_t entityIdA, uint32_t entityIdB, float anchorAx, float anchorAy, float anchorBx, float anchorBy, float length, int enableSpring, float hertz, float dampingRatio, int enableLimit, float minLength, float maxLength, int enableMotor, float maxMotorForce, float motorSpeed, int collideConnected) |
| int | physics_createPrismaticJoint (uint32_t entityIdA, uint32_t entityIdB, float anchorAx, float anchorAy, float anchorBx, float anchorBy, float axisX, float axisY, int enableSpring, float hertz, float dampingRatio, int enableLimit, float lowerTranslation, float upperTranslation, int enableMotor, float maxMotorForce, float motorSpeed, int collideConnected) |
| int | physics_createWeldJoint (uint32_t entityIdA, uint32_t entityIdB, float anchorAx, float anchorAy, float anchorBx, float anchorBy, float linearHertz, float angularHertz, float linearDampingRatio, float angularDampingRatio, int collideConnected) |
| int | physics_createWheelJoint (uint32_t entityIdA, uint32_t entityIdB, float anchorAx, float anchorAy, float anchorBx, float anchorBy, float axisX, float axisY, int enableSpring, float hertz, float dampingRatio, int enableLimit, float lowerTranslation, float upperTranslation, int enableMotor, float maxMotorTorque, float motorSpeed, int collideConnected) |
| float | physics_getDistanceJointLength (uint32_t entityId) |
| float | physics_getDistanceJointCurrentLength (uint32_t entityId) |
| void | physics_setDistanceJointLength (uint32_t entityId, float length) |
| void | physics_enableDistanceJointSpring (uint32_t entityId, int enable) |
| void | physics_enableDistanceJointLimit (uint32_t entityId, int enable) |
| void | physics_setDistanceJointLimits (uint32_t entityId, float minLength, float maxLength) |
| void | physics_enableDistanceJointMotor (uint32_t entityId, int enable) |
| void | physics_setDistanceJointMotorSpeed (uint32_t entityId, float speed) |
| void | physics_setDistanceJointMaxMotorForce (uint32_t entityId, float force) |
| float | physics_getDistanceJointMotorForce (uint32_t entityId) |
| float | physics_getPrismaticJointTranslation (uint32_t entityId) |
| float | physics_getPrismaticJointSpeed (uint32_t entityId) |
| void | physics_enablePrismaticJointSpring (uint32_t entityId, int enable) |
| void | physics_enablePrismaticJointLimit (uint32_t entityId, int enable) |
| void | physics_setPrismaticJointLimits (uint32_t entityId, float lower, float upper) |
| void | physics_enablePrismaticJointMotor (uint32_t entityId, int enable) |
| void | physics_setPrismaticJointMotorSpeed (uint32_t entityId, float speed) |
| void | physics_setPrismaticJointMaxMotorForce (uint32_t entityId, float force) |
| float | physics_getPrismaticJointMotorForce (uint32_t entityId) |
| void | physics_enableWheelJointSpring (uint32_t entityId, int enable) |
| void | physics_enableWheelJointLimit (uint32_t entityId, int enable) |
| void | physics_setWheelJointLimits (uint32_t entityId, float lower, float upper) |
| void | physics_enableWheelJointMotor (uint32_t entityId, int enable) |
| void | physics_setWheelJointMotorSpeed (uint32_t entityId, float speed) |
| void | physics_setWheelJointMaxMotorTorque (uint32_t entityId, float torque) |
| float | physics_getWheelJointMotorTorque (uint32_t entityId) |
| int | physics_createMotorJoint (uint32_t entityIdA, uint32_t entityIdB, float linearVelX, float linearVelY, float maxVelocityForce, float angularVelocity, float maxVelocityTorque, float linearHertz, float linearDampingRatio, float maxSpringForce, float angularHertz, float angularDampingRatio, float maxSpringTorque, int collideConnected) |
| void | physics_setMotorJointLinearVelocity (uint32_t entityId, float vx, float vy) |
| void | physics_setMotorJointAngularVelocity (uint32_t entityId, float omega) |
| void | physics_setMotorJointMaxVelocityForce (uint32_t entityId, float force) |
| void | physics_setMotorJointMaxVelocityTorque (uint32_t entityId, float torque) |
| int | physics_createMouseJoint (uint32_t entityId, float targetX, float targetY, float hertz, float dampingRatio, float maxForce) |
| void | physics_setMouseTarget (float targetX, float targetY) |
| void | physics_destroyMouseJoint () |
| int | physics_hasMouseJoint () |
| int | physics_raycast (float originX, float originY, float dirX, float dirY, float maxDistance, uint32_t maskBits) |
| uintptr_t | physics_getRaycastBuffer () |
| int | physics_overlapCircle (float centerX, float centerY, float radius, uint32_t maskBits) |
| uintptr_t | physics_getOverlapBuffer () |
| int | physics_shapeCastCircle (float centerX, float centerY, float radius, float translationX, float translationY, uint32_t maskBits) |
| int | physics_shapeCastBox (float centerX, float centerY, float halfW, float halfH, float angle, float translationX, float translationY, uint32_t maskBits) |
| int | physics_shapeCastCapsule (float center1X, float center1Y, float center2X, float center2Y, float radius, float translationX, float translationY, uint32_t maskBits) |
| uintptr_t | physics_getShapeCastBuffer () |
| int | physics_overlapAABB (float minX, float minY, float maxX, float maxY, uint32_t maskBits) |
| int | physics_moveCharacter (float px, float py, float c1x, float c1y, float c2x, float c2y, float radius, float velX, float velY, float dt, float upX, float upY, float floorCos, uint32_t maskBits, uint32_t selfEntity, float skinWidth, int maxSlides, float snapLength, int slideOnCeiling, float carryX, float carryY, uint32_t flags, float stepHeight) |
| uintptr_t | physics_getMoveCharacterBuffer () |
| size_t | physics_dynamicBodyTransformsBytes () |
| size_t | physics_interpolatedTransformsBytes () |
| size_t | physics_collisionEnterBytes () |
| size_t | physics_collisionExitBytes () |
| size_t | physics_sensorEnterBytes () |
| size_t | physics_sensorExitBytes () |
| size_t | physics_hitEventBytes () |
| size_t | physics_raycastBytes () |
| size_t | physics_overlapBytes () |
| size_t | physics_shapeCastBytes () |
| size_t | physics_moveCharacterBytes () |
The Box2D module's entry points, declared once for both platforms.
The physics module is plain C: extern "C" functions over a Box2D world, which the web build links into its own wasm side module and exports by KEEPALIVE. There were no declarations anywhere — the SDK's PhysicsWasmModule interface was the only statement of this surface, and it could drift from the C++ silently.
Declaring them here gives the surface one source: the same file the web module compiles from, and the file EHT reads to generate the QuickJS wrappers a native host binds (eht --native-functions). A native build compiles these TUs and Box2D into the host binary — no side module, since there is no dynamic-linking story to have on a device.
Bulk data crosses as an offset into the caller's heap (wasm linear memory on the web, the host arena on a device), which is why the readback getters carry an @heapreturn annotation: they hand back memory the MODULE owns, so a native wrapper copies exactly that many bytes into the heap the SDK reads. The byte counts come from the module, never from a stride guessed on the far side — see the *Bytes helpers at the end.
Definition in file PhysicsBindings.hpp.
| void physics_addBoxShape | ( | uint32_t | entityId, |
| float | halfW, | ||
| float | halfH, | ||
| float | offX, | ||
| float | offY, | ||
| float | radius, | ||
| float | density, | ||
| float | friction, | ||
| float | restitution, | ||
| int | isSensor, | ||
| uint32_t | categoryBits, | ||
| uint32_t | maskBits ) |
Definition at line 10 of file PhysicsShapes.cpp.
References g_ctx.
| void physics_addCapsuleShape | ( | uint32_t | entityId, |
| float | radius, | ||
| float | halfHeight, | ||
| float | offX, | ||
| float | offY, | ||
| float | density, | ||
| float | friction, | ||
| float | restitution, | ||
| int | isSensor, | ||
| uint32_t | categoryBits, | ||
| uint32_t | maskBits ) |
Definition at line 68 of file PhysicsShapes.cpp.
References g_ctx.
| void physics_addChainShape | ( | uint32_t | entityId, |
| uintptr_t | pointsPtr, | ||
| int | pointCount, | ||
| int | isLoop, | ||
| float | friction, | ||
| float | restitution, | ||
| uint32_t | categoryBits, | ||
| uint32_t | maskBits ) |
Definition at line 158 of file PhysicsShapes.cpp.
References esengine::boundarySpan(), and g_ctx.
| void physics_addCircleShape | ( | uint32_t | entityId, |
| float | radius, | ||
| float | offX, | ||
| float | offY, | ||
| float | density, | ||
| float | friction, | ||
| float | restitution, | ||
| int | isSensor, | ||
| uint32_t | categoryBits, | ||
| uint32_t | maskBits ) |
Definition at line 41 of file PhysicsShapes.cpp.
References g_ctx.
| void physics_addPolygonShape | ( | uint32_t | entityId, |
| uintptr_t | verticesPtr, | ||
| int | vertexCount, | ||
| float | radius, | ||
| float | density, | ||
| float | friction, | ||
| float | restitution, | ||
| int | isSensor, | ||
| uint32_t | categoryBits, | ||
| uint32_t | maskBits ) |
Definition at line 122 of file PhysicsShapes.cpp.
References esengine::boundarySpan(), and g_ctx.
| void physics_addSegmentShape | ( | uint32_t | entityId, |
| float | x1, | ||
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float | density, | ||
| float | friction, | ||
| float | restitution, | ||
| int | isSensor, | ||
| uint32_t | categoryBits, | ||
| uint32_t | maskBits ) |
Definition at line 96 of file PhysicsShapes.cpp.
References g_ctx.
| void physics_applyAngularImpulse | ( | uint32_t | entityId, |
| float | impulse ) |
Definition at line 721 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_applyForce | ( | uint32_t | entityId, |
| float | forceX, | ||
| float | forceY ) |
Definition at line 611 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_applyImpulse | ( | uint32_t | entityId, |
| float | impulseX, | ||
| float | impulseY ) |
Definition at line 621 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_applyTorque | ( | uint32_t | entityId, |
| float | torque ) |
Definition at line 713 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_capturePoses | ( | ) |
Promote the current snapshot to prev and refill it from the world. Called once per fixed step, after the step, so the pair always straddles one step.
Definition at line 393 of file PhysicsModuleEntry.cpp.
References g_ctx, and pushEntityBits().
| void physics_clearShapes | ( | uint32_t | entityId | ) |
Definition at line 196 of file PhysicsShapes.cpp.
References g_ctx.
| void physics_collectEvents | ( | ) |
Definition at line 475 of file PhysicsModuleEntry.cpp.
References entityFromShape(), g_ctx, and pushEntityBits().
| size_t physics_collisionEnterBytes | ( | ) |
Definition at line 43 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| size_t physics_collisionExitBytes | ( | ) |
Definition at line 47 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| void physics_createBody | ( | uint32_t | entityId, |
| int | bodyType, | ||
| float | x, | ||
| float | y, | ||
| float | angle, | ||
| float | gravityScale, | ||
| float | linearDamping, | ||
| float | angularDamping, | ||
| int | fixedRotation, | ||
| int | bullet ) |
Definition at line 143 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_createDistanceJoint | ( | uint32_t | entityIdA, |
| uint32_t | entityIdB, | ||
| float | anchorAx, | ||
| float | anchorAy, | ||
| float | anchorBx, | ||
| float | anchorBy, | ||
| float | length, | ||
| int | enableSpring, | ||
| float | hertz, | ||
| float | dampingRatio, | ||
| int | enableLimit, | ||
| float | minLength, | ||
| float | maxLength, | ||
| int | enableMotor, | ||
| float | maxMotorForce, | ||
| float | motorSpeed, | ||
| int | collideConnected ) |
Definition at line 115 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_createMotorJoint | ( | uint32_t | entityIdA, |
| uint32_t | entityIdB, | ||
| float | linearVelX, | ||
| float | linearVelY, | ||
| float | maxVelocityForce, | ||
| float | angularVelocity, | ||
| float | maxVelocityTorque, | ||
| float | linearHertz, | ||
| float | linearDampingRatio, | ||
| float | maxSpringForce, | ||
| float | angularHertz, | ||
| float | angularDampingRatio, | ||
| float | maxSpringTorque, | ||
| int | collideConnected ) |
Definition at line 441 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_createMouseJoint | ( | uint32_t | entityId, |
| float | targetX, | ||
| float | targetY, | ||
| float | hertz, | ||
| float | dampingRatio, | ||
| float | maxForce ) |
Definition at line 506 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_createPrismaticJoint | ( | uint32_t | entityIdA, |
| uint32_t | entityIdB, | ||
| float | anchorAx, | ||
| float | anchorAy, | ||
| float | anchorBx, | ||
| float | anchorBy, | ||
| float | axisX, | ||
| float | axisY, | ||
| int | enableSpring, | ||
| float | hertz, | ||
| float | dampingRatio, | ||
| int | enableLimit, | ||
| float | lowerTranslation, | ||
| float | upperTranslation, | ||
| int | enableMotor, | ||
| float | maxMotorForce, | ||
| float | motorSpeed, | ||
| int | collideConnected ) |
Definition at line 152 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_createRevoluteJoint | ( | uint32_t | entityIdA, |
| uint32_t | entityIdB, | ||
| float | anchorAx, | ||
| float | anchorAy, | ||
| float | anchorBx, | ||
| float | anchorBy, | ||
| int | enableMotor, | ||
| float | motorSpeed, | ||
| float | maxMotorTorque, | ||
| int | enableLimit, | ||
| float | lowerAngle, | ||
| float | upperAngle, | ||
| int | collideConnected ) |
Definition at line 11 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_createWeldJoint | ( | uint32_t | entityIdA, |
| uint32_t | entityIdB, | ||
| float | anchorAx, | ||
| float | anchorAy, | ||
| float | anchorBx, | ||
| float | anchorBy, | ||
| float | linearHertz, | ||
| float | angularHertz, | ||
| float | linearDampingRatio, | ||
| float | angularDampingRatio, | ||
| int | collideConnected ) |
Definition at line 197 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_createWheelJoint | ( | uint32_t | entityIdA, |
| uint32_t | entityIdB, | ||
| float | anchorAx, | ||
| float | anchorAy, | ||
| float | anchorBx, | ||
| float | anchorBy, | ||
| float | axisX, | ||
| float | axisY, | ||
| int | enableSpring, | ||
| float | hertz, | ||
| float | dampingRatio, | ||
| int | enableLimit, | ||
| float | lowerTranslation, | ||
| float | upperTranslation, | ||
| int | enableMotor, | ||
| float | maxMotorTorque, | ||
| float | motorSpeed, | ||
| int | collideConnected ) |
Definition at line 227 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_destroyBody | ( | uint32_t | entityId | ) |
Definition at line 175 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_destroyJoint | ( | uint32_t | entityId | ) |
Definition at line 43 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_destroyMouseJoint | ( | ) |
Definition at line 560 of file PhysicsJoints.cpp.
References g_ctx.
| size_t physics_dynamicBodyTransformsBytes | ( | ) |
Definition at line 35 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| void physics_enableDistanceJointLimit | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 298 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enableDistanceJointMotor | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 310 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enableDistanceJointSpring | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 292 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enablePrismaticJointLimit | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 355 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enablePrismaticJointMotor | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 367 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enablePrismaticJointSpring | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 349 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enableRevoluteLimit | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 78 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_enableRevoluteMotor | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 70 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_enableWheelJointLimit | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 398 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enableWheelJointMotor | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 410 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_enableWheelJointSpring | ( | uint32_t | entityId, |
| int | enable ) |
Definition at line 392 of file PhysicsJoints.cpp.
References findValidJoint().
| float physics_getAngularVelocity | ( | uint32_t | entityId | ) |
Definition at line 703 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getBodyCenterOfMass | ( | uint32_t | entityId | ) |
Definition at line 800 of file PhysicsModuleEntry.cpp.
References findValidBody(), and g_massDataBuffer.
| int physics_getBodyCount | ( | ) |
Definition at line 315 of file PhysicsModuleEntry.cpp.
References g_ctx.
| float physics_getBodyInertia | ( | uint32_t | entityId | ) |
Definition at line 793 of file PhysicsModuleEntry.cpp.
References findValidBody().
| float physics_getBodyMass | ( | uint32_t | entityId | ) |
Definition at line 786 of file PhysicsModuleEntry.cpp.
References findValidBody().
| uintptr_t physics_getCollisionEnterBuffer | ( | ) |
Definition at line 564 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getCollisionEnterCount | ( | ) |
Definition at line 559 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getCollisionExitBuffer | ( | ) |
Definition at line 584 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getCollisionExitCount | ( | ) |
Definition at line 579 of file PhysicsModuleEntry.cpp.
References g_ctx.
| float physics_getDistanceJointCurrentLength | ( | uint32_t | entityId | ) |
Definition at line 279 of file PhysicsJoints.cpp.
References findValidJoint().
| float physics_getDistanceJointLength | ( | uint32_t | entityId | ) |
Definition at line 272 of file PhysicsJoints.cpp.
References findValidJoint().
| float physics_getDistanceJointMotorForce | ( | uint32_t | entityId | ) |
Definition at line 328 of file PhysicsJoints.cpp.
References findValidJoint().
| int physics_getDynamicBodyCount | ( | ) |
Definition at line 307 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getDynamicBodyTransforms | ( | ) |
Definition at line 341 of file PhysicsModuleEntry.cpp.
References g_ctx, and pushEntityBits().
| uintptr_t physics_getGravity | ( | ) |
Definition at line 675 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getHitEventBuffer | ( | ) |
Definition at line 574 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getHitEventCount | ( | ) |
Definition at line 569 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getInterpolatedCount | ( | ) |
Definition at line 416 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getInterpolatedTransforms | ( | float | alpha | ) |
Interpolate the snapshot pair by alpha into a flat [entityBits, x, y, angle] buffer (physics space) and return it. With alpha = 1 this reproduces a direct post-step sync.
Definition at line 426 of file PhysicsModuleEntry.cpp.
References g_ctx, lerpAngleShortest(), and poseEntityAt().
| int physics_getJointCount | ( | ) |
Definition at line 327 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getLinearVelocity | ( | uint32_t | entityId | ) |
Definition at line 645 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getMoveCharacterBuffer | ( | ) |
Definition at line 524 of file PhysicsQueries.cpp.
References g_moverBuffer.
| uintptr_t physics_getOverlapBuffer | ( | ) |
Definition at line 316 of file PhysicsQueries.cpp.
References g_overlapBuffer.
| float physics_getPrismaticJointMotorForce | ( | uint32_t | entityId | ) |
Definition at line 385 of file PhysicsJoints.cpp.
References findValidJoint().
| float physics_getPrismaticJointSpeed | ( | uint32_t | entityId | ) |
Definition at line 342 of file PhysicsJoints.cpp.
References findValidJoint().
| float physics_getPrismaticJointTranslation | ( | uint32_t | entityId | ) |
Definition at line 335 of file PhysicsJoints.cpp.
References findValidJoint().
| uintptr_t physics_getRaycastBuffer | ( | ) |
Definition at line 294 of file PhysicsQueries.cpp.
References g_raycastBuffer.
| float physics_getRevoluteAngle | ( | uint32_t | entityId | ) |
Definition at line 94 of file PhysicsJoints.cpp.
References g_ctx.
| float physics_getRevoluteMotorTorque | ( | uint32_t | entityId | ) |
Definition at line 102 of file PhysicsJoints.cpp.
References g_ctx.
| uintptr_t physics_getSensorEnterBuffer | ( | ) |
Definition at line 594 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getSensorEnterCount | ( | ) |
Definition at line 589 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getSensorExitBuffer | ( | ) |
Definition at line 604 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getSensorExitCount | ( | ) |
Definition at line 599 of file PhysicsModuleEntry.cpp.
References g_ctx.
| uintptr_t physics_getShapeCastBuffer | ( | ) |
Definition at line 378 of file PhysicsQueries.cpp.
References g_shapeCastBuffer.
| int physics_getShapeCount | ( | ) |
Definition at line 320 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_getTrackingRows | ( | ) |
Rows in the side tables keyed by entity. They are invisible to gameplay and are exactly where a destroy path that forgets one map shows up.
Definition at line 334 of file PhysicsModuleEntry.cpp.
References g_ctx.
| float physics_getWheelJointMotorTorque | ( | uint32_t | entityId | ) |
Definition at line 428 of file PhysicsJoints.cpp.
References findValidJoint().
| int physics_hasBody | ( | uint32_t | entityId | ) |
Definition at line 201 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_hasJoint | ( | uint32_t | entityId | ) |
Definition at line 110 of file PhysicsJoints.cpp.
References g_ctx.
| int physics_hasMouseJoint | ( | ) |
Definition at line 568 of file PhysicsJoints.cpp.
References g_ctx.
| size_t physics_hitEventBytes | ( | ) |
Definition at line 59 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| void physics_init | ( | float | gx, |
| float | gy, | ||
| float | timestep, | ||
| int | substeps, | ||
| float | contactHertz, | ||
| float | contactDampingRatio, | ||
| float | contactSpeed ) |
Definition at line 64 of file PhysicsModuleEntry.cpp.
References g_ctx, and preSolveOneWayPlatform().
| size_t physics_interpolatedTransformsBytes | ( | ) |
Definition at line 39 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| int physics_isAwake | ( | uint32_t | entityId | ) |
Definition at line 776 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_moveCharacter | ( | float | px, |
| float | py, | ||
| float | c1x, | ||
| float | c1y, | ||
| float | c2x, | ||
| float | c2y, | ||
| float | radius, | ||
| float | velX, | ||
| float | velY, | ||
| float | dt, | ||
| float | upX, | ||
| float | upY, | ||
| float | floorCos, | ||
| uint32_t | maskBits, | ||
| uint32_t | selfEntity, | ||
| float | skinWidth, | ||
| int | maxSlides, | ||
| float | snapLength, | ||
| int | slideOnCeiling, | ||
| float | carryX, | ||
| float | carryY, | ||
| uint32_t | flags, | ||
| float | stepHeight ) |
Definition at line 401 of file PhysicsQueries.cpp.
References g_ctx, g_moverBuffer, g_moverDt, g_moverFlags, g_moverHitCount, g_moverHitEntity, g_moverHitNormal, g_moverPlaneCount, g_moverPlaneEntity, g_moverPlanes, g_moverSelfEntity, g_moverVelocity, g_snapClosest, g_snapEntity, g_snapFloorCos, g_snapHit, g_snapNormal, g_snapUp, MOVER_BLOCK_STEEP, MOVER_WAS_ON_FLOOR, and snapCastCallback().
| size_t physics_moveCharacterBytes | ( | ) |
Definition at line 77 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE.
| int physics_overlapAABB | ( | float | minX, |
| float | minY, | ||
| float | maxX, | ||
| float | maxY, | ||
| uint32_t | maskBits ) |
Definition at line 383 of file PhysicsQueries.cpp.
References g_ctx, g_overlapBuffer, and overlapCallback().
| size_t physics_overlapBytes | ( | ) |
Definition at line 67 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_overlapBuffer.
| int physics_overlapCircle | ( | float | centerX, |
| float | centerY, | ||
| float | radius, | ||
| uint32_t | maskBits ) |
Definition at line 299 of file PhysicsQueries.cpp.
References g_ctx, g_overlapBuffer, and overlapCallback().
| int physics_raycast | ( | float | originX, |
| float | originY, | ||
| float | dirX, | ||
| float | dirY, | ||
| float | maxDistance, | ||
| uint32_t | maskBits ) |
Definition at line 276 of file PhysicsQueries.cpp.
References g_ctx, g_raycastBuffer, RAYCAST_STRIDE, and raycastCallback().
| size_t physics_raycastBytes | ( | ) |
Definition at line 63 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_raycastBuffer.
| size_t physics_sensorEnterBytes | ( | ) |
Definition at line 51 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| size_t physics_sensorExitBytes | ( | ) |
Definition at line 55 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_ctx.
| void physics_setAngularVelocity | ( | uint32_t | entityId, |
| float | omega ) |
Definition at line 690 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_setAwake | ( | uint32_t | entityId, |
| int | awake ) |
Definition at line 768 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_setBodyEnabled | ( | uint32_t | entityId, |
| int | enabled ) |
Definition at line 209 of file PhysicsModuleEntry.cpp.
References findValidBody(), and g_ctx.
| void physics_setBodyTargetTransform | ( | uint32_t | entityId, |
| float | x, | ||
| float | y, | ||
| float | angle, | ||
| float | dt ) |
Definition at line 297 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_setBodyTransform | ( | uint32_t | entityId, |
| float | x, | ||
| float | y, | ||
| float | angle ) |
Definition at line 259 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_setBodyTransforms | ( | uintptr_t | bufferPtr, |
| int | count, | ||
| float | ppu ) |
Definition at line 268 of file PhysicsModuleEntry.cpp.
References esengine::boundarySpan(), and g_ctx.
| void physics_setDistanceJointLength | ( | uint32_t | entityId, |
| float | length ) |
Definition at line 286 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setDistanceJointLimits | ( | uint32_t | entityId, |
| float | minLength, | ||
| float | maxLength ) |
Definition at line 304 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setDistanceJointMaxMotorForce | ( | uint32_t | entityId, |
| float | force ) |
Definition at line 322 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setDistanceJointMotorSpeed | ( | uint32_t | entityId, |
| float | speed ) |
Definition at line 316 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setGravity | ( | float | gx, |
| float | gy ) |
Definition at line 669 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_setLinearVelocity | ( | uint32_t | entityId, |
| float | vx, | ||
| float | vy ) |
Definition at line 631 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_setMotorJointAngularVelocity | ( | uint32_t | entityId, |
| float | omega ) |
Definition at line 481 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setMotorJointLinearVelocity | ( | uint32_t | entityId, |
| float | vx, | ||
| float | vy ) |
Definition at line 475 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setMotorJointMaxVelocityForce | ( | uint32_t | entityId, |
| float | force ) |
Definition at line 487 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setMotorJointMaxVelocityTorque | ( | uint32_t | entityId, |
| float | torque ) |
Definition at line 493 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setMouseTarget | ( | float | targetX, |
| float | targetY ) |
Definition at line 550 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_setOneWayPlatform | ( | uint32_t | entityId, |
| float | nx, | ||
| float | ny, | ||
| int | enable ) |
Definition at line 113 of file PhysicsModuleEntry.cpp.
References g_ctx.
Referenced by physics_setOneWayPlatformLocal().
| void physics_setOneWayPlatformLocal | ( | uint32_t | entityId, |
| float | nx, | ||
| float | ny, | ||
| int | enable ) |
Definition at line 135 of file PhysicsModuleEntry.cpp.
References g_ctx, and physics_setOneWayPlatform().
| void physics_setPrismaticJointLimits | ( | uint32_t | entityId, |
| float | lower, | ||
| float | upper ) |
Definition at line 361 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setPrismaticJointMaxMotorForce | ( | uint32_t | entityId, |
| float | force ) |
Definition at line 379 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setPrismaticJointMotorSpeed | ( | uint32_t | entityId, |
| float | speed ) |
Definition at line 373 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setRevoluteLimits | ( | uint32_t | entityId, |
| float | lower, | ||
| float | upper ) |
Definition at line 86 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_setRevoluteMaxMotorTorque | ( | uint32_t | entityId, |
| float | torque ) |
Definition at line 62 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_setRevoluteMotorSpeed | ( | uint32_t | entityId, |
| float | speed ) |
Definition at line 54 of file PhysicsJoints.cpp.
References g_ctx.
| void physics_setWheelJointLimits | ( | uint32_t | entityId, |
| float | lower, | ||
| float | upper ) |
Definition at line 404 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setWheelJointMaxMotorTorque | ( | uint32_t | entityId, |
| float | torque ) |
Definition at line 422 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setWheelJointMotorSpeed | ( | uint32_t | entityId, |
| float | speed ) |
Definition at line 416 of file PhysicsJoints.cpp.
References findValidJoint().
| void physics_setWorldConfig | ( | int | enableSleep, |
| int | enableContinuous, | ||
| float | restitutionThreshold, | ||
| float | maxLinearSpeed ) |
Definition at line 91 of file PhysicsModuleEntry.cpp.
References g_ctx.
| int physics_shapeCastBox | ( | float | centerX, |
| float | centerY, | ||
| float | halfW, | ||
| float | halfH, | ||
| float | angle, | ||
| float | translationX, | ||
| float | translationY, | ||
| uint32_t | maskBits ) |
Definition at line 340 of file PhysicsQueries.cpp.
References g_ctx, g_shapeCastBuffer, SHAPECAST_STRIDE, and shapeCastCallback().
| size_t physics_shapeCastBytes | ( | ) |
Definition at line 71 of file PhysicsReadback.cpp.
References EMSCRIPTEN_KEEPALIVE, and g_shapeCastBuffer.
| int physics_shapeCastCapsule | ( | float | center1X, |
| float | center1Y, | ||
| float | center2X, | ||
| float | center2Y, | ||
| float | radius, | ||
| float | translationX, | ||
| float | translationY, | ||
| uint32_t | maskBits ) |
Definition at line 359 of file PhysicsQueries.cpp.
References g_ctx, g_shapeCastBuffer, SHAPECAST_STRIDE, and shapeCastCallback().
| int physics_shapeCastCircle | ( | float | centerX, |
| float | centerY, | ||
| float | radius, | ||
| float | translationX, | ||
| float | translationY, | ||
| uint32_t | maskBits ) |
Definition at line 321 of file PhysicsQueries.cpp.
References g_ctx, g_shapeCastBuffer, SHAPECAST_STRIDE, and shapeCastCallback().
| void physics_shutdown | ( | ) |
Definition at line 105 of file PhysicsModuleEntry.cpp.
References g_ctx.
| void physics_step | ( | float | dt | ) |
Definition at line 233 of file PhysicsModuleEntry.cpp.
References g_ctx, and MAX_PHYSICS_STEPS_PER_FRAME.
| void physics_updateBodyProperties | ( | uint32_t | entityId, |
| int | bodyType, | ||
| float | gravityScale, | ||
| float | linearDamping, | ||
| float | angularDamping, | ||
| int | fixedRotation, | ||
| int | bullet ) |
Definition at line 731 of file PhysicsModuleEntry.cpp.
References g_ctx.