载入中...
搜索中...
未找到
Physics.cpp
浏览该文件的文档.
48DistanceField3D* Physics::newDistanceField3D(int width, int height, int depth, float cellSize, float originX,
50 return new DistanceField3D(width, height, depth, cellSize, originX, originY, originZ, outsideDistance);
53SoftBody3D* Physics::newSoftBody3D(int cols, int rows, int layers, float spacing, float originX, float originY,
60SoftBody3DRenderer* Physics::newSoftBody3DRenderer(SoftBody3D* body) { return new SoftBody3DRenderer(body); }
76 terrainLoadState.addFunc("isActivationScheduled", &TerrainLoadGravityState::isActivationScheduled);
83 table.addFunc("advanceTerrainLoadGravity", [vm = table.getHandle()](TerrainLoadGravityState* state, Body3D* body,
85 return eve::script::projectResult(vm, advanceTerrainLoadGravity(state, body, terrainLoaded, dt, delay),
89 auto world = table.addClass<World>("World", std::function<World*()>([]() -> World* { return nullptr; }), true);
157 table.addClass<World3D>("World3D", std::function<World3D*()>([]() -> World3D* { return nullptr; }), true);
160 [](World3D* self, ssq::Object event, float ix, float iy, float iz, float px, float py, float pz) {
195 world3.addFunc("getExplosionResultDeltaAngularVelocityX", &World3D::getExplosionResultDeltaAngularVelocityX);
196 world3.addFunc("getExplosionResultDeltaAngularVelocityY", &World3D::getExplosionResultDeltaAngularVelocityY);
197 world3.addFunc("getExplosionResultDeltaAngularVelocityZ", &World3D::getExplosionResultDeltaAngularVelocityZ);
374 world3.addFunc("getContactPointTotalNormalImpulse", &World3D::getContactPointTotalNormalImpulse);
414 "DistanceField3D", std::function<DistanceField3D*()>([]() -> DistanceField3D* { return nullptr; }), true);
423 [](DistanceField3D* field, int x, int y, int z, int width, int height, int depth, ssq::Array values) {
487 auto body = table.addClass<Body>("Body", std::function<Body*()>([]() -> Body* { return nullptr; }), true);
544 auto body3 = table.addClass<Body3D>("Body3D", std::function<Body3D*()>([]() -> Body3D* { return nullptr; }), true);
634 body3.addFunc("newTriangleMeshShape", [](Body3D* body, ssq::Array vertexValues, ssq::Array indexValues) {
639 for (size_t i = 0; i < vertexValues.size(); ++i) vertices.push_back(vertexValues.get<float>(i));
650 for (size_t i = 0; i < vertexValues.size(); ++i) vertices.push_back(vertexValues.get<float>(i));
652 return body->newTriangleMeshShape(vertices, indices, weldVertices, weldTolerance, identifyEdges,
655 body3.addFunc("newHeightFieldShape", [](Body3D* body, int countX, int countZ, float cellSizeX, float cellSizeZ,
662 return body->newHeightFieldShape(countX, countZ, cellSizeX, cellSizeZ, heights, *range.first, *range.second);
676 table.addClass<Joint3D>("Joint3D", std::function<Joint3D*()>([]() -> Joint3D* { return nullptr; }), true);
771 table.addClass<Fixture>("Fixture", std::function<Fixture*()>([]() -> Fixture* { return nullptr; }), true);
794 table.addClass<Shape3D>("Shape3D", std::function<Shape3D*()>([]() -> Shape3D* { return nullptr; }), true);
807 shape3.addFunc("setConvexHullVertices", [](Shape3D* shape, ssq::Array values, int maxVertices) {
815 shape3.addFunc("setTriangleMeshData", [](Shape3D* shape, ssq::Array vertexValues, ssq::Array indexValues) {
820 for (size_t i = 0; i < vertexValues.size(); ++i) vertices.push_back(vertexValues.get<float>(i));
831 for (size_t i = 0; i < vertexValues.size(); ++i) vertices.push_back(vertexValues.get<float>(i));
833 shape->setTriangleMeshData(vertices, indices, weldVertices, weldTolerance, identifyEdges, useMedianSplit);
847 shape3.addFunc("getTriangleMeshMaterialRestitution", &Shape3D::getTriangleMeshMaterialRestitution);
848 shape3.addFunc("getTriangleMeshMaterialRollingResistance", &Shape3D::getTriangleMeshMaterialRollingResistance);
856 shape3.addFunc("setHeightFieldRegion", [](Shape3D* shape, int x, int z, int width, int depth, ssq::Array values) {
908 shape3.addFunc("getCategoryBits", [](Shape3D* shape) { return static_cast<int64_t>(shape->getCategoryBits()); });
911 shape3.addFunc("getMaskBits", [](Shape3D* shape) { return static_cast<int64_t>(shape->getMaskBits()); });
969 "SoftBody3DRenderer", std::function<SoftBody3DRenderer*()>([]() -> SoftBody3DRenderer* { return nullptr; }),
976 table.addClass<Fluid2D>("Fluid2D", std::function<Fluid2D*()>([]() -> Fluid2D* { return nullptr; }), true);
1020 cls.addFunc("distanceField3DFromSdfBlob", [vm](Physics*, ssq::Object object) -> DistanceField3D* {
1026 if (!field) throw Exception("Physics.distanceField3DFromSdfBlob: cannot import VertexGrid blob");
1033 vm, Status::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "Missing distance field",
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
static Status failure(StatusCode code, Diagnostic diagnostic)
Construct a failed status with one diagnostic.
Definition Status.cpp:28
void setRotation(float qx, float qy, float qz, float qw)
Orientation as quaternion (x, y, z, w).
Definition Body3D.cpp:109
std::vector< float > localToWorldVector(float x, float y, float z) const
Rotates a body-local direction/vector into world space; returns {x,y,z}.
Definition Body3D.cpp:179
std::vector< float > worldToLocalVector(float x, float y, float z) const
Rotates a world direction/vector into body-local space; returns {x,y,z}.
Definition Body3D.cpp:186
void setAngularDamping(float damping)
Angular damping coefficient, finite and non-negative.
Definition Body3D.cpp:263
void applyForce(float fx, float fy, float fz)
Force applied at the center of mass.
Definition Body3D.cpp:201
std::vector< float > localToWorldPoint(float x, float y, float z) const
Converts a body-local point to world coordinates; returns {x,y,z}.
Definition Body3D.cpp:165
void applyLinearImpulse(float ix, float iy, float iz)
Instantaneous linear impulse.
Definition Body3D.cpp:213
void setFixedRotation(bool fixed)
Lock all angular axes (Box3D motion locks).
Definition Body3D.cpp:400
void applyAngularImpulse(float ix, float iy, float iz)
Instantaneous angular impulse.
Definition Body3D.cpp:221
float getInertiaYY() const
Local inertia tensor YY component about the center of mass.
Definition Body3D.cpp:339
void setLinearDamping(float damping)
Linear damping coefficient, finite and non-negative.
Definition Body3D.cpp:255
std::vector< float > worldToLocalPoint(float x, float y, float z) const
Converts a world point to body-local coordinates; returns {x,y,z}.
Definition Body3D.cpp:172
void applyLocalForceToCenter(float fx, float fy, float fz)
Body-local force applied at the center of mass.
Definition Body3D.cpp:229
Shape3D * newBoxShape(float width, float height, float depth, float density=1.f, float friction=0.2f, float restitution=0.f)
Creates a box shape in meter-space units.
Definition Body3D.cpp:440
void applyLinearImpulseAt(float ix, float iy, float iz, float x, float y, float z)
Instantaneous linear impulse applied at a world position.
Definition Body3D.cpp:217
void setMassProperties(float mass, float centerX, float centerY, float centerZ, float inertiaXX, float inertiaYY, float inertiaZZ, float inertiaXY=0.f, float inertiaXZ=0.f, float inertiaYZ=0.f)
Overrides mass, local center of mass, and the symmetric local inertia tensor.
Definition Body3D.cpp:324
void setTargetTransform(float x, float y, float z, float qx, float qy, float qz, float qw, float timeStep)
Drives a kinematic body to a target pose over a positive time step. The target quaternion is normaliz...
Definition Body3D.cpp:250
void applyLocalForce(float fx, float fy, float fz, float x, float y, float z)
Body-local force applied at a body-local point.
Definition Body3D.cpp:225
void setSleepEnabled(bool enabled)
Enables or disables automatic sleeping for this body.
Definition Body3D.cpp:279
void applyLocalLinearImpulseToCenter(float ix, float iy, float iz)
Body-local linear impulse applied at the center of mass.
Definition Body3D.cpp:242
void applyTorque(float tx, float ty, float tz)
Torque applied in world space.
Definition Body3D.cpp:209
float getInertiaXX() const
Local inertia tensor XX component about the center of mass.
Definition Body3D.cpp:335
void setMotionLocks(bool linearX, bool linearY, bool linearZ, bool angularX, bool angularY, bool angularZ)
Atomically locks translation and rotation on individual local solver axes.
Definition Body3D.cpp:295
void applyForceAt(float fx, float fy, float fz, float x, float y, float z)
Force applied at a world position.
Definition Body3D.cpp:205
void resetMassProperties()
Restores automatic mass, center, and inertia calculation from attached shapes.
Definition Body3D.cpp:331
float getInertiaZZ() const
Local inertia tensor ZZ component about the center of mass.
Definition Body3D.cpp:343
Shape3D * newCapsuleShape(float height, float radius, float density=1.f, float friction=0.2f, float restitution=0.f)
Creates a capsule along local Y.
Definition Body3D.cpp:454
void setLinearVelocity(float vx, float vy, float vz)
Linear velocity in m/s.
Definition Body3D.cpp:129
void applyLocalLinearImpulse(float ix, float iy, float iz, float x, float y, float z)
Body-local linear impulse applied at a body-local point.
Definition Body3D.cpp:237
void setGravityScale(float scale)
Multiplier applied to world gravity; may be negative.
Definition Body3D.cpp:271
void setType(const std::string &bodyType)
"static" | "kinematic" | "dynamic".
Definition Body3D.cpp:383
std::vector< float > getWorldPointVelocity(float x, float y, float z) const
World-space velocity at the supplied world point.
Definition Body3D.cpp:197
void setAngularVelocity(float wx, float wy, float wz)
Angular velocity in rad/s.
Definition Body3D.cpp:149
void setSleepThreshold(float threshold)
Sleep velocity threshold, finite and non-negative.
Definition Body3D.cpp:287
std::vector< float > getLocalPointVelocity(float x, float y, float z) const
World-space velocity at a point expressed in body-local coordinates.
Definition Body3D.cpp:190
Shape3D * newSphereShape(float radius, float density=1.f, float friction=0.2f, float restitution=0.f)
Creates a sphere shape in meter-space units.
Definition Body3D.cpp:448
void applyLocalAngularImpulse(float ix, float iy, float iz)
Body-local angular impulse.
Definition Body3D.cpp:246
Fixture * newRectangleFixture(float width, float height, float density=1.f, float friction=0.2f, float restitution=0.f)
Creates a rectangle fixture in pixel-space units.
Definition Body.cpp:230
void applyForceAt(float fx, float fy, float x, float y)
Force applied at a world pixel position.
Definition Body.cpp:175
void setBullet(bool bullet)
CCD bullet mode (recommended for fast small bodies).
Definition Body.cpp:216
Fixture * newCircleFixture(float radius, float density=1.f, float friction=0.2f, float restitution=0.f)
Creates a circular fixture in pixel-space units.
Definition Body.cpp:258
void applyForce(float fx, float fy)
Force (pixels/s² * kg) applied at the center of mass.
Definition Body.cpp:169
Fixture * newRectangleFixtureAt(float width, float height, float offsetX, float offsetY, float density=1.f, float friction=0.2f, float restitution=0.f)
Creates an offset rectangle fixture in pixel-space units.
Definition Body.cpp:235
Regular 3D signed-distance grid for terrain and voxel collision queries. Negative samples are solid,...
Definition DistanceField3D.h:16
float getMoverGroundDot() const
Greatest dot product between mover Up and a normal from the latest move.
Definition DistanceField3D.h:169
void setMoverGroundSnap(float distance)
Set the non-negative distance used to snap onto walkable ground after movement.
Definition DistanceField3D.cpp:394
float getCollisionDistance() const
Signed clearance from the last check (negative means penetration).
Definition DistanceField3D.h:125
float getCastDistance() const
World-space travel distance at the last cast hit.
Definition DistanceField3D.h:149
void fill(float distance)
Set every grid sample to the same finite distance.
Definition DistanceField3D.cpp:67
bool moveCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius, float deltaX, float deltaY, float deltaZ)
Resolve a capsule displacement against the field with sliding and depenetration. The capsule coordina...
Definition DistanceField3D.cpp:408
float getCollisionY() const
Y coordinate of the closest sampled point from the last collision check.
Definition DistanceField3D.h:129
void setMoverUp(float x, float y, float z)
Set the normalized reference-up direction used for ground classification.
Definition DistanceField3D.cpp:370
void fillRegion(int x, int y, int z, int width, int height, int depth, float distance)
Fill an in-bounds grid subregion with one finite signed distance.
Definition DistanceField3D.cpp:99
bool isMoverGrounded() const
Whether the latest move encountered a normal within the walkable slope limit.
Definition DistanceField3D.h:167
float getMoverGroundSnap() const
Current post-move ground-snap distance.
Definition DistanceField3D.h:119
void sampleNormal(float x, float y, float z)
Estimate the normalized outward field gradient at a world position.
Definition DistanceField3D.cpp:152
float getOriginX() const
World-space X coordinate of grid vertex (0,0,0).
Definition DistanceField3D.h:58
float getMoverStepHeight() const
Current automatic step height; zero disables step climbing.
Definition DistanceField3D.h:123
bool checkCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius)
Test a capsule defined by two sphere centers against the solid.
Definition DistanceField3D.cpp:211
float getOriginY() const
World-space Y coordinate of grid vertex (0,0,0).
Definition DistanceField3D.h:60
float getCellSize() const
World-space distance between adjacent grid vertices.
Definition DistanceField3D.h:56
float getOutsideDistance() const
Distance returned for world samples outside the grid.
Definition DistanceField3D.h:64
float getNormalZ() const
Z component of the most recently sampled collision normal.
Definition DistanceField3D.h:75
float getMoverDeltaX() const
Resolved X displacement from the most recent moveCapsule call.
Definition DistanceField3D.h:153
unsigned int getRevision() const
Monotonic wrapping counter incremented once after each successful mutation.
Definition DistanceField3D.h:66
float getShapeContactY() const
Y coordinate on the sphere or capsule surface along the contact normal.
Definition DistanceField3D.h:141
void setMoverSlopeLimit(float degrees)
Set the maximum walkable slope angle in degrees, clamped to [0, 89.9].
Definition DistanceField3D.cpp:381
bool castCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius, float deltaX, float deltaY, float deltaZ)
Sweep a capsule through the field and cache the earliest contact.
Definition DistanceField3D.cpp:314
float getNormalX() const
X component of the most recently sampled collision normal.
Definition DistanceField3D.h:71
bool castSphere(float x, float y, float z, float radius, float deltaX, float deltaY, float deltaZ)
Sweep a sphere through the field and cache the earliest contact.
Definition DistanceField3D.cpp:266
float getMoverNormalX() const
X component of the most recent blocking or recovery normal.
Definition DistanceField3D.h:159
float getMoverDeltaZ() const
Resolved Z displacement from the most recent moveCapsule call.
Definition DistanceField3D.h:157
bool didCastStartInside() const
Whether the most recent cast began overlapping the solid.
Definition DistanceField3D.h:151
float getCollisionX() const
X coordinate of the closest sampled point from the last collision check.
Definition DistanceField3D.h:127
int getMoverIterations() const
Number of solver passes used by the most recent moveCapsule call.
Definition DistanceField3D.h:165
float getShapeContactZ() const
Z coordinate on the sphere or capsule surface along the contact normal.
Definition DistanceField3D.h:143
float getNormalY() const
Y component of the most recently sampled collision normal.
Definition DistanceField3D.h:73
bool didMoverHitWall() const
Whether the latest move encountered a non-walkable contact normal.
Definition DistanceField3D.h:171
void setMoverSkinWidth(float width)
Set the non-negative separation retained from surfaces by moveCapsule.
Definition DistanceField3D.cpp:388
float getSurfaceX() const
X coordinate of the projected signed-distance-field surface point.
Definition DistanceField3D.h:133
float getCastFraction() const
Fraction in [0,1] of the requested displacement at the last cast hit.
Definition DistanceField3D.h:147
float getMoverDeltaY() const
Resolved Y displacement from the most recent moveCapsule call.
Definition DistanceField3D.h:155
void setDistance(int x, int y, int z, float distance)
Set a signed-distance sample at a grid vertex.
Definition DistanceField3D.cpp:115
float getCollisionZ() const
Z coordinate of the closest sampled point from the last collision check.
Definition DistanceField3D.h:131
float getShapeContactX() const
X coordinate on the sphere or capsule surface along the contact normal.
Definition DistanceField3D.h:139
bool checkSphere(float x, float y, float z, float radius)
Test a sphere against the solid (distance <= radius).
Definition DistanceField3D.cpp:204
float getPenetrationDepth() const
Non-negative overlap depth from the most recent overlap, cast, or move query.
Definition DistanceField3D.h:145
float getSurfaceZ() const
Z coordinate of the projected signed-distance-field surface point.
Definition DistanceField3D.h:137
float getSurfaceY() const
Y coordinate of the projected signed-distance-field surface point.
Definition DistanceField3D.h:135
float getMoverNormalZ() const
Z component of the most recent blocking or recovery normal.
Definition DistanceField3D.h:163
void setMoverStepHeight(float height)
Set the maximum non-negative ledge height automatically climbed by moveCapsule.
Definition DistanceField3D.cpp:401
float getMoverSkinWidth() const
Current mover separation from collision surfaces.
Definition DistanceField3D.h:115
float sample(float x, float y, float z) const
Trilinearly sample the field in world coordinates.
Definition DistanceField3D.cpp:127
float getOriginZ() const
World-space Z coordinate of grid vertex (0,0,0).
Definition DistanceField3D.h:62
float getDistance(int x, int y, int z) const
Read a grid vertex; out-of-range vertices return the outside distance.
Definition DistanceField3D.cpp:123
float getMoverNormalY() const
Y component of the most recent blocking or recovery normal.
Definition DistanceField3D.h:161
void setSensor(bool sensor)
Sensor fixtures report contacts but never collide.
Definition Fixture.cpp:43
bool testPoint(float x, float y) const
Pixel-space point-in-fixture test (uses World meter).
Definition Fixture.cpp:105
void setCategoryBits(int bits)
Collision filtering (Box2D category/mask bits, group index).
Definition Fixture.cpp:72
void setTag(const std::string &tag)
Arbitrary string tag surfaced in begin/end contact events.
Definition Fixture.h:49
Interactive 2D particle fluid (double-density relaxation) in pixel space. Script-owned; independent o...
Definition Fluid2D.h:19
void setBounds(float x, float y, float w, float h)
Axis-aligned container; particles bounce inside.
Definition Fluid2D.cpp:51
void setRestDensity(float density)
Target rest density for the relaxation solver (default 4).
Definition Fluid2D.cpp:38
int emit(float x, float y, int count, float vx=0.f, float vy=0.f)
Spawn up to count particles at (x,y) with initial velocity. Returns number actually added.
Definition Fluid2D.cpp:65
void setSmoothingRadius(float radius)
Interaction / neighbor radius in pixels (default 18).
Definition Fluid2D.cpp:33
void setNearPressureStiffness(float k)
Near-pressure (anti-clustering) stiffness (default 0.5).
Definition Fluid2D.cpp:45
void interactAt(float x, float y, float radius, float strength)
Mouse / pointer interaction: positive strength attracts, negative repels. Applied as acceleration wit...
Definition Fluid2D.cpp:89
float getConstraintForceX() const
Current world-space constraint force X in newtons.
Definition Joint3D.cpp:92
void setDistanceLength(float length)
Changes distance-joint rest length in metres.
Definition Joint3D.cpp:124
float getConstraintForceY() const
Current world-space constraint force Y in newtons.
Definition Joint3D.cpp:96
void setForceThreshold(float threshold)
Sets the force threshold that emits a joint-stress event, in newtons.
Definition Joint3D.cpp:75
void setWheelSteering(bool enabled, float targetAngle, float hertz, float dampingRatio, float maxTorque)
Configures steering target, stiffness, damping and maximum torque.
Definition Joint3D.cpp:182
void setMotorVelocityLimits(float maxForce, float maxTorque)
Sets motor velocity force/torque limits.
Definition Joint3D.cpp:209
void setWheelSpinMotor(bool enabled, float speed, float maxTorque)
Configures wheel spin motor speed and maximum torque.
Definition Joint3D.cpp:179
void setSphericalTwistLimits(bool enabled, float lower, float upper)
Enables spherical twist limits in radians.
Definition Joint3D.cpp:164
float getTorqueThreshold() const
Current torque event threshold in newton-metres.
Definition Joint3D.cpp:87
float getParallelMaxTorque() const
Parallel maximum spring torque in newton-metres.
Definition Joint3D.cpp:229
float getWheelSpinTorque() const
Current wheel spin motor torque in newton-metres.
Definition Joint3D.cpp:190
void setRevoluteLimits(bool enabled, float lower, float upper)
Configures revolute angular limits in radians.
Definition Joint3D.cpp:140
void setDistanceMotor(bool enabled, float speed, float maxForce)
Configures the distance motor in metres/second and newtons.
Definition Joint3D.cpp:133
float getRevoluteMotorTorque() const
Current revolute motor torque in newton-metres.
Definition Joint3D.cpp:147
void setMotorAngularVelocity(float wx, float wy, float wz)
Sets motor-joint relative angular velocity in radians/second.
Definition Joint3D.cpp:206
void setSphericalMotor(bool enabled, float velocityX, float velocityY, float velocityZ, float maxTorque)
Configures spherical motor velocity and maximum torque.
Definition Joint3D.cpp:167
void setTorqueThreshold(float threshold)
Sets the torque threshold that emits a joint-stress event, in newton-metres.
Definition Joint3D.cpp:83
void setWeldLinearSpring(float hertz, float dampingRatio)
Configures weld linear spring stiffness and damping; 0 hertz is rigid.
Definition Joint3D.cpp:193
float getDistanceCurrentLength() const
Current anchor-to-anchor distance in metres.
Definition Joint3D.cpp:126
float getPrismaticTranslation() const
Current prismatic translation in metres.
Definition Joint3D.cpp:158
void setDistanceLimits(bool enabled, float minimum, float maximum)
Configures optional distance limits in metres.
Definition Joint3D.cpp:130
float getConstraintTorqueZ() const
Current world-space constraint torque Z in newton-metres.
Definition Joint3D.cpp:112
float getWheelSpinSpeed() const
Current wheel spin speed in radians/second.
Definition Joint3D.cpp:189
void setWheelSteeringLimits(bool enabled, float lower, float upper)
Configures steering angular limits in radians.
Definition Joint3D.cpp:186
float getPrismaticMotorForce() const
Current prismatic motor force in newtons.
Definition Joint3D.cpp:160
void setRevoluteSpring(bool enabled, float targetAngle, float hertz, float dampingRatio)
Configures a revolute angular spring in radians.
Definition Joint3D.cpp:136
void setPrismaticLimits(bool enabled, float lower, float upper)
Configures prismatic translation limits in metres.
Definition Joint3D.cpp:152
std::string getKind() const
Joint kind string for script/debug ("distance", "revolute", …, "filter").
Definition Joint3D.cpp:43
float getMotorLinearVelocityX() const
Desired motor linear velocity X in metres/second.
Definition Joint3D.cpp:218
void setParallelSpring(float hertz, float dampingRatio, float maxTorque)
Configures parallel-joint spring stiffness, damping and torque cap.
Definition Joint3D.cpp:224
void setMotorLinearVelocity(float vx, float vy, float vz)
Sets motor-joint relative linear velocity in metres/second.
Definition Joint3D.cpp:203
float getMotorAngularVelocityY() const
Desired motor angular velocity Y in radians/second.
Definition Joint3D.cpp:222
float getLinearSeparation() const
Current inadmissible linear separation error in metres.
Definition Joint3D.cpp:116
float getMotorAngularVelocityX() const
Desired motor angular velocity X in radians/second.
Definition Joint3D.cpp:221
float getWheelSteeringTorque() const
Current steering torque in newton-metres.
Definition Joint3D.cpp:192
float getMotorAngularVelocityZ() const
Desired motor angular velocity Z in radians/second.
Definition Joint3D.cpp:223
float getConstraintTorqueX() const
Current world-space constraint torque X in newton-metres.
Definition Joint3D.cpp:104
float getConstraintForceZ() const
Current world-space constraint force Z in newtons.
Definition Joint3D.cpp:100
float getMotorLinearVelocityY() const
Desired motor linear velocity Y in metres/second.
Definition Joint3D.cpp:219
float getAngularSeparation() const
Current inadmissible angular separation error in radians.
Definition Joint3D.cpp:120
float getMotorLinearVelocityZ() const
Desired motor linear velocity Z in metres/second.
Definition Joint3D.cpp:220
float getWheelSteeringAngle() const
Current wheel steering angle in radians.
Definition Joint3D.cpp:191
void setDistanceSpring(bool enabled, float hertz, float dampingRatio)
Configures a distance spring; hertz and damping must be non-negative.
Definition Joint3D.cpp:127
void setRevoluteMotor(bool enabled, float speed, float maxTorque)
Configures the revolute motor in radians/second and newton-metres.
Definition Joint3D.cpp:143
int getBodyAId() const
Stable ID of attached body A, or -1 after invalidation.
Definition Joint3D.cpp:58
void setWheelSuspensionLimits(bool enabled, float lower, float upper)
Configures wheel suspension travel limits in metres.
Definition Joint3D.cpp:176
float getPrismaticSpeed() const
Current prismatic translation speed in metres/second.
Definition Joint3D.cpp:159
void setMotorAngularSpring(float hertz, float dampingRatio, float maxTorque)
Configures motor angular position spring.
Definition Joint3D.cpp:215
float getSphericalConeAngle() const
Current spherical cone angle in radians.
Definition Joint3D.cpp:171
void setPrismaticMotor(bool enabled, float speed, float maxForce)
Configures a prismatic motor in metres/second and newtons.
Definition Joint3D.cpp:155
void setSphericalConeLimit(bool enabled, float angle)
Enables a spherical cone limit in radians, within [0, pi].
Definition Joint3D.cpp:161
void setWeldAngularSpring(float hertz, float dampingRatio)
Configures weld angular spring stiffness and damping; 0 hertz is rigid.
Definition Joint3D.cpp:196
int getBodyBId() const
Stable ID of attached body B, or -1 after invalidation.
Definition Joint3D.cpp:59
void setWheelSuspension(bool enabled, float hertz, float dampingRatio)
Configures wheel suspension spring stiffness and damping.
Definition Joint3D.cpp:173
void setPrismaticSpring(bool enabled, float targetTranslation, float hertz, float dampingRatio)
Configures a prismatic linear spring and target translation.
Definition Joint3D.cpp:148
float getConstraintTorqueY() const
Current world-space constraint torque Y in newton-metres.
Definition Joint3D.cpp:108
float getSphericalTwistAngle() const
Current spherical twist angle in radians.
Definition Joint3D.cpp:172
void setCollideConnected(bool collide)
Enables or disables collision between the attached bodies.
Definition Joint3D.cpp:67
void setMotorLinearSpring(float hertz, float dampingRatio, float maxForce)
Configures motor linear position spring.
Definition Joint3D.cpp:212
Joint2D * getSliderJoint() const
Frame-to-slider prismatic, or null for shaft/ratchet.
Definition Mechanism2D.h:74
float getRatchetEngagementTorque() const
Current ratchet engagement torque in newton-metres.
Definition Mechanism2D.h:101
void setRatchetDirection(int direction)
Sets ratchet freewheel direction (+1 or -1).
Definition Mechanism2D.cpp:91
std::string getKind() const
Kind name: "crankSlider", "shaft", or "ratchet".
Definition Mechanism2D.cpp:29
int getRatchetDirection() const
Current ratchet freewheel direction (+1 or -1).
Definition Mechanism2D.h:97
void setRatchetEngagementTorque(float torque)
Sets reverse-lock torque for ratchet engagement.
Definition Mechanism2D.cpp:98
Joint2D * getDriveJoint() const
Primary revolute (crank / shaft / ratchet wheel).
Definition Mechanism2D.h:53
float getSliderTranslation() const
Current slider translation in pixels (crank-slider only).
Definition Mechanism2D.cpp:57
Joint2D * getCrankPinJoint() const
Crank-to-rod revolute, or null for shaft/ratchet.
Definition Mechanism2D.h:60
void setDrive(float speed, float maxTorque)
Enables a continuous drive motor on the primary revolute.
Definition Mechanism2D.cpp:72
bool isValid() const
Whether the assembly and its primary joints are still live.
Definition Mechanism2D.cpp:38
Joint2D * getSliderPinJoint() const
Rod-to-slider revolute, or null for shaft/ratchet.
Definition Mechanism2D.h:67
bool isDriveEnabled() const
Whether a continuous drive motor is configured.
Definition Mechanism2D.h:92
Joint3D * getCrankPinJoint() const
Crank-to-rod revolute, or null for shaft/ratchet.
Definition Mechanism3D.h:55
float getSliderTranslation() const
Current slider translation in metres (crank-slider only).
Definition Mechanism2D.cpp:189
void setRatchetEngagementTorque(float torque)
Sets reverse-lock torque for ratchet engagement.
Definition Mechanism2D.cpp:240
void setRatchetDirection(int direction)
Sets ratchet freewheel direction.
Definition Mechanism2D.cpp:233
float getDriveAngle() const
Current drive revolute angle in radians (shaft/crank/ratchet).
Definition Mechanism2D.cpp:184
void setDrive(float speed, float maxTorque)
Enables a continuous drive motor on the primary revolute.
Definition Mechanism2D.cpp:210
Joint3D * getSliderPinJoint() const
Rod-to-slider revolute, or null for shaft/ratchet.
Definition Mechanism3D.h:62
bool isValid() const
Whether the assembly and its primary joints are still live.
Definition Mechanism2D.cpp:170
int getRatchetDirection() const
Current ratchet freewheel direction (+1 or -1).
Definition Mechanism3D.h:96
std::string getKind() const
Kind name: "crankSlider", "shaft", or "ratchet".
Definition Mechanism2D.cpp:161
float getRatchetEngagementTorque() const
Current ratchet engagement torque in newton-metres.
Definition Mechanism3D.h:103
bool isDriveEnabled() const
Whether a continuous drive motor is configured.
Definition Mechanism3D.h:88
Joint3D * getDriveJoint() const
Primary revolute (crank / shaft / ratchet wheel).
Definition Mechanism3D.h:48
Joint3D * getSliderJoint() const
Frame-to-slider prismatic, or null for shaft/ratchet.
Definition Mechanism3D.h:69
float getSpinSpeed() const
Relative spin speed along the drive axis in radians/second.
Definition Mechanism2D.cpp:205
static SSQ_REG PhysicsBakeRecording * create()
Borrow the stateless compatibility facade for the Squirrel factory ABI. @ownership Process-owned; no ...
Definition PhysicsBakeRecording.cpp:114
static SSQ_REG PhysicsBake * create()
Borrow the stateless compatibility facade for the Squirrel factory ABI. @ownership Process-owned; no ...
Definition PhysicsBake.cpp:309
Physics module — Box2D (2D) + Box3D (3D) rigid bodies and SPH fluid. Script: physics <- eve....
Definition Physics.h:22
DistanceField3D * newDistanceField3D(int width, int height, int depth, float cellSize, float originX=0.f, float originY=0.f, float originZ=0.f, float outsideDistance=1e6f)
Create a regular 3D signed-distance grid for map collision queries.
Definition Physics.cpp:48
World3D * newWorld3D(float gravityX, float gravityY, float gravityZ, bool sleep=true)
Create a 3D Box3D physics world. Coordinates are meters (Box3D native); +Y is up by convention.
Definition PhysicsWorldFactory.cpp:11
World3D * newWorld3DWithBackend(const std::string &backend, float gravityX, float gravityY, float gravityZ, bool sleep=true)
Compatibility script factory selecting "box3d" or "jolt" explicitly.
Definition PhysicsWorldFactory.cpp:15
void setMeter(float pixelsPerMeter)
Pixels per meter for 2D Box2D worlds (default 30, same as LÖVE).
Definition Physics.cpp:41
SoftBody3DRenderer * newSoftBody3DRenderer(SoftBody3D *body)
Create a presentation satellite observing a soft-body runtime.
Definition Physics.cpp:60
Fluid2D * newFluid2D(int capacity=512)
Creates an interactive 2D particle fluid in pixel space.
Definition Physics.cpp:62
World * newWorld(float gravityX, float gravityY, bool sleep=true)
Create a 2D Box2D physics world.
Definition PhysicsWorldFactory.cpp:7
SoftBody3D * newSoftBody3D(int cols, int rows, int layers, float spacing, float originX, float originY, float originZ)
Compatibility factory for a volumetric shape-matching soft body.
Definition Physics.cpp:53
int getId() const
Stable world-local id, preserved when sensor state recreates the backend shape.
Definition Shape3D.h:48
float getHeightFieldCellSizeZ() const
Height-field cell spacing along local Z, or zero.
Definition Shape3D.h:151
void setLocalPosition(float x, float y, float z)
Sets local translation while preserving local rotation.
Definition Shape3D.cpp:487
void setTag(int tag)
User-defined integer tag preserved for the wrapper lifetime.
Definition Shape3D.cpp:120
void setBoxSize(float width, float height, float depth)
Atomically changes full box dimensions in meters.
Definition Shape3D.cpp:198
int getHeightFieldCountZ() const
Height-field sample count along local Z, or zero.
Definition Shape3D.h:145
float getTriangleMeshMaterialRestitution(int slot) const
Restitution of a triangle-mesh material slot.
Definition Shape3D.cpp:387
int getTriangleMeshMaterialId(int slot) const
Application material ID of a triangle-mesh material slot.
Definition Shape3D.cpp:401
void setOneWay(float nx, float ny, float nz, float planeOffset, float margin, float minNormalDot)
Enables a one-way collision plane in shape-local space.
Definition Shape3D.cpp:134
int getTriangleMeshVertexCount() const
Source vertex count for a triangle mesh, or zero.
Definition Shape3D.h:96
std::string getKind() const
Kind name including primitives, "convexHull", "triangleMesh", or "heightField".
Definition Shape3D.cpp:186
bool testPoint(float x, float y, float z) const
Point-in-shape test in world meters.
Definition Shape3D.cpp:648
void setHitEventsEnabled(bool enabled)
Enables significant collision hit events for this shape.
Definition Shape3D.cpp:125
void setMaterialId(int id)
Sets a low-32-bit application material identifier exposed by native queries.
Definition Shape3D.cpp:550
int getTriangleMeshMaterialIndex(int triangleIndex) const
Material-slot index assigned to a source triangle.
Definition Shape3D.cpp:335
void setTriangleMeshMaterial(int slot, float friction, float restitution, float rollingResistance, float tangentX, float tangentY, float tangentZ, int materialId, const std::string &frictionMode, const std::string &restitutionMode)
Replaces one triangle-mesh material slot without rebuilding geometry.
Definition Shape3D.cpp:350
float getHeightFieldHeight(int x, int z) const
Source height at a grid sample.
Definition Shape3D.cpp:441
int getTriangleMeshMaterialCount() const
Number of material slots on a triangle mesh, otherwise zero.
Definition Shape3D.cpp:346
float getTangentVelocityY() const
Local-space conveyor velocity Y component.
Definition Shape3D.cpp:542
float getTriangleMeshMaterialRollingResistance(int slot) const
Rolling resistance of a triangle-mesh material slot.
Definition Shape3D.cpp:393
void setRestitution(float restitution)
Definition Shape3D.cpp:506
void setSphereRadius(float radius)
Atomically changes sphere radius in meters.
Definition Shape3D.cpp:217
float getBoxHeight() const
Full box height, or zero for another geometry kind.
Definition Shape3D.h:165
void setLocalTransform(float px, float py, float pz, float qx, float qy, float qz, float qw)
Atomically sets the shape transform relative to its Body3D.
Definition Shape3D.cpp:450
void setGroupIndex(int index)
Collision group; negative never collides, positive always collides.
Definition Shape3D.cpp:639
float getTriangleMeshMaterialFriction(int slot) const
Friction of a triangle-mesh material slot.
Definition Shape3D.cpp:381
float getHeightFieldGlobalMin() const
Height-field shared quantization minimum, or zero.
Definition Shape3D.h:155
void setFrictionCombineMode(const std::string &mode)
Sets friction combine mode: default, average, minimum, multiply, or maximum.
Definition Shape3D.cpp:558
void setLocalRotation(float qx, float qy, float qz, float qw)
Sets local rotation while preserving local translation.
Definition Shape3D.cpp:491
void setTangentVelocity(float x, float y, float z)
Sets local-space conveyor velocity projected onto contact surfaces.
Definition Shape3D.cpp:529
float getExplosionScale() const
Current explosion impulse multiplier; zero opts this shape out.
Definition Shape3D.h:251
float getCapsuleHeight() const
Capsule hemisphere-center distance, or zero for another kind.
Definition Shape3D.h:173
int getHeightFieldCountX() const
Height-field sample count along local X, or zero.
Definition Shape3D.h:143
void setCapsuleSize(float height, float radius)
Atomically changes capsule segment height and radius in meters.
Definition Shape3D.cpp:230
float getHeightFieldCellSizeX() const
Height-field cell spacing along local X, or zero.
Definition Shape3D.h:147
float getHeightFieldGlobalMax() const
Height-field shared quantization maximum, or zero.
Definition Shape3D.h:159
void setRestitutionCombineMode(const std::string &mode)
Sets restitution combine mode: default, average, minimum, multiply, or maximum.
Definition Shape3D.cpp:572
float getTangentVelocityZ() const
Local-space conveyor velocity Z component.
Definition Shape3D.cpp:546
int getTriangleMeshTriangleCount() const
Source triangle count for a triangle mesh, or zero.
Definition Shape3D.h:100
std::string getRestitutionCombineMode() const
Current restitution combine mode.
Definition Shape3D.cpp:581
void setRollingResistance(float resistance)
Rolling resistance coefficient, finite and non-negative.
Definition Shape3D.cpp:515
void disableOneWay()
Disables one-way filtering and restores ordinary two-sided collision.
Definition Shape3D.cpp:158
void setSensor(bool sensor)
Sensor shapes report contacts but never collide.
Definition Shape3D.cpp:102
int getConvexHullPointCount() const
Source point count for a convex hull, or zero for another kind.
Definition Shape3D.h:82
bool areHitEventsEnabled() const
Whether significant collision hit events are enabled.
Definition Shape3D.cpp:130
void setExplosionScale(float scale)
Sets non-negative multiplier applied to geometry-aware explosion impulses.
Definition Shape3D.cpp:590
int getConvexHullMaxVertices() const
Current convex-hull simplification budget, or zero for another kind.
Definition Shape3D.h:86
float getTangentVelocityX() const
Local-space conveyor velocity X component.
Definition Shape3D.cpp:538
float getRollingResistance() const
Current rolling resistance; physically affects spheres and capsules.
Definition Shape3D.cpp:525
Presentation-only renderer for a borrowed volumetric soft body.
Definition SoftBody3DRenderer.h:21
void draw(graphics::Graphics *graphics)
Update the surface cache and draw it in the current 3D frame.
Definition SoftBody3DGraphics.cpp:29
void setBody(SoftBody3D *body)
Replace the borrowed runtime; null disables drawing.
Definition SoftBody3DGraphics.cpp:15
void setColor(float r, float g, float b, float a)
Set the clamped RGBA presentation color.
Definition SoftBody3DGraphics.cpp:22
Volumetric particle soft body using overlapping shape-matching clusters.
Definition SoftBody3D.h:27
void update(float dt)
Advances using a legacy variable timestep clamped to 50 ms.
Definition SoftBody3D.cpp:409
void setBounds(float x, float y, float z, float width, float height, float depth)
Sets the bounds.
Definition SoftBody3D.cpp:153
float getParticleZ(int index) const
Definition SoftBody3D.cpp:230
void setDeformationResistance(float value)
Sets the deformation resistance.
Definition SoftBody3D.cpp:126
void setCollideWorld(World3D *world)
Borrows a rigid-body world used for particle contacts.
Definition SoftBody3DWorldBridge.cpp:69
float getVolumeRatio() const
Returns current cell volume divided by undeformed rest volume.
Definition SoftBody3D.cpp:456
void setPlasticity(float yield, float creep, float recovery, float maxDeformation)
Sets the plasticity.
Definition SoftBody3D.cpp:140
void setParticlePosition(int index, float x, float y, float z)
Definition SoftBody3D.cpp:234
float getDeformationResistance() const
Returns the deformation resistance.
Definition SoftBody3D.cpp:128
static eve::Result< std::unique_ptr< SoftBody3D > > create(const SoftBody3DDefinition &definition)
Creates a soft body from the canonical versioned definition.
Definition SoftBody3D.cpp:54
void interactAt(float x, float y, float z, float radius, float strength)
Interact at.
Definition SoftBody3D.cpp:213
float getParticleX(int index) const
Definition SoftBody3D.cpp:222
float getParticleY(int index) const
Definition SoftBody3D.cpp:226
bool isCompleted() const
Whether gravity restoration and the activation notification completed.
Definition TerrainLoadGravity.h:18
bool isMonitoring() const
Whether a containing terrain was found and activation is being monitored.
Definition TerrainLoadGravity.h:14
bool isActivationScheduled() const
Whether the post-load delay has been scheduled.
Definition TerrainLoadGravity.h:16
float getDelayElapsed() const
Elapsed seconds since the first loaded observation.
Definition TerrainLoadGravity.h:20
bool hasClosestPoint() const
Whether the latest closestPoint call found a shape.
Definition World3D.h:687
int getBeginTriggerVisitorShapeId(int index) const
Visitor shape ID of a begin-trigger event.
float getProfileStepMs() const
Latest complete physics step time in milliseconds.
Definition World3D.cpp:223
float getRestitutionThreshold() const
Current restitution speed threshold in m/s.
Definition World3D.cpp:128
int getBeginContactShapeAId(int index) const
Shape ID on stable side A of a begin-contact event.
float getShapeCastX() const
World-space contact point X from the last shape cast.
Definition World3D.h:722
int getEndTriggerCount() const
Number of sensor overlaps that ended during the latest step.
Definition World3D.h:860
float getJointStressForceY(int index) const
Constraint force Y of a stress event.
int getClosestShapeId() const
Stable shape id from the latest closestPoint call, or -1.
Definition World3D.h:691
float getContactPointTotalNormalImpulse(int index) const
Total normal impulse accumulated across all physics substeps.
int getRayHitTriangleIndex() const
Mesh/height-field triangle index from the last ray cast, otherwise -1.
Definition World3D.h:530
float getHitNormalX(int index) const
Hit normal X, pointing from stable side A to B.
int castSphere(float x, float y, float z, float radius, float dx, float dy, float dz)
Sweep a sphere through the world and return the earliest hit body id, or -1.
Definition World3DQueries.cpp:74
bool isWarmStartingEnabled() const
Whether constraint warm starting is enabled.
Definition World3D.cpp:153
int getShapeCastResultShapeId(int index) const
Shape ID of a sorted Shape Cast result.
float getMaximumLinearSpeed() const
Current world-wide maximum linear speed in m/s.
Definition World3D.cpp:147
int getBeginTriggerSensorBodyId(int index) const
Sensor body ID of a begin-trigger event.
Joint3D * newMotorJoint(Body3D *bodyA, Body3D *bodyB, bool collideConnected=false)
Creates a motor joint that drives relative linear/angular velocity between bodies.
Definition World3DJoints.cpp:49
float getContactPushOutSpeed() const
Current maximum contact push-out speed in m/s.
Definition World3D.h:223
int queryCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius)
Query shapes overlapping an arbitrarily oriented capsule. The endpoints are the centers of its hemisp...
Definition World3DQueries.cpp:57
float getContactPointNormalImpulse(int index) const
Normal impulse from the final physics substep.
int getEndContactShapeBId(int index) const
Shape ID on stable side B of an end-contact event.
void update(float dt)
Steps the simulation by dt seconds (default substep count).
Definition World3DSimulation.cpp:27
int closestPoint(float x, float y, float z, float maxDistance)
Find the closest collision surface within maxDistance of a world point. Uses the current query catego...
Definition World3DQueries.cpp:108
float getShapeCastResultFraction(int index) const
Translation fraction in [0,1] of a Shape Cast result.
int getClosestShapeTag() const
User tag of the shape from the latest closestPoint call, or zero.
Definition World3D.h:693
int getEndContactBodyAId(int index) const
Body ID on stable side A of an end-contact event.
int getEndContactShapeATag(int index) const
Shape Tag on stable side A of an end-contact event.
int getShapeCastShapeId() const
Stable shape id from the last shape cast, or -1.
Definition World3D.h:714
int getRayResultTriangleIndex(int index) const
Mesh/height-field triangle index of a sorted ray result, otherwise -1.
float getShapeCastZ() const
World-space contact point Z from the last shape cast.
Definition World3D.h:726
float getContactPointX(int index) const
World-space contact point X on the queried body.
int castBox(float x, float y, float z, float width, float height, float depth, float qx, float qy, float qz, float qw, float dx, float dy, float dz)
Sweep an oriented box without changing its rotation.
Definition World3DQueries.cpp:96
int getBeginContactBodyBId(int index) const
Body ID on stable side B of a begin-contact event.
int getContactPointOtherShapeId(int index) const
Other Shape ID of a contact point.
float getMoverNormalY() const
Representative blocking normal Y from the last move.
Definition World3D.h:789
int getQueryShapeCount() const
Number of individual shapes hit by the last overlap query.
Definition World3D.h:810
Joint3D * newWeldJoint(Body3D *bodyA, Body3D *bodyB, float anchorX, float anchorY, float anchorZ, bool collideConnected=false)
Welds two bodies at a shared world-space anchor, preserving current relative pose.
Definition World3DJoints.cpp:37
float getBoundsMinZ() const
Minimum world-space Z covered by current broad-phase bounds.
Definition World3D.cpp:190
float getExplosionResultDeltaVelocityX(int index) const
Explosion-induced linear velocity delta X.
int getQueryShapeId(int index) const
Stable shape id of the i-th shape hit, sorted ascending.
Definition World3DMover.cpp:111
float getRayResultNormalY(int index) const
Surface normal Y of a sorted ray result.
float getProfileBulletsMs() const
Latest continuous-collision bullet time in milliseconds.
Definition World3D.cpp:231
void setBodyPairCollisionEnabled(Body3D *bodyA, Body3D *bodyB, bool enabled)
Overrides collision for a live body pair without changing layer masks.
Definition World3D.cpp:341
float getContactPointSeparation(int index) const
Signed surface separation; negative values indicate penetration.
int getHitShapeBId(int index) const
Stable Shape ID on side B of a hit.
float getClosestNormalX() const
Surface-to-target normal X, or zero for an inside/on-surface target.
Definition World3D.h:701
int getQueryShapeTag(int index) const
User tag paired with the i-th shape hit.
Definition World3DMover.cpp:117
Joint3D * newParallelJoint(Body3D *bodyA, Body3D *bodyB, float axisX, float axisY, float axisZ, bool collideConnected=false)
Creates a parallel joint that spring-aligns body local Z axes to a world axis.
Definition World3DJoints.cpp:60
float getMoverDeltaZ() const
Resolved translation Z from the last moveCapsule call.
Definition World3D.h:785
float getProfileCollideMs() const
Latest narrow-phase collision time in milliseconds.
Definition World3D.cpp:227
void setMoverUp(float x, float y, float z)
Set the up direction used for grounded and slope classification.
Definition World3DMover.cpp:11
int getHitCount() const
Number of significant collision hits generated during the latest step.
Definition World3D.h:931
Joint3D * newSphericalJoint(Body3D *bodyA, Body3D *bodyB, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected=false)
Creates a ball-and-socket joint with a world-space twist/cone axis.
Definition World3DJoints.cpp:203
std::string queryToken() const
Opaque process-local query token; re-fetch after restore, never persist in save data.
Definition WorldSphereSweep.cpp:79
int getJointStressKind(int index) const
Joint kind code: 0 distance, 1 revolute, 2 prismatic, 3 spherical, 4 wheel.
int getShapeCastShapeTag() const
User tag of the shape from the last shape cast, or zero on no hit.
Definition World3D.h:716
Joint3D * newRevoluteJoint(Body3D *bodyA, Body3D *bodyB, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected=false)
Creates a hinge around a normalized world-space axis at a shared anchor.
Definition World3DJoints.cpp:177
float getMoverDeltaY() const
Resolved translation Y from the last moveCapsule call.
Definition World3D.h:783
int getBeginTriggerCount() const
Number of sensor overlaps that began during the latest step.
Definition World3D.h:846
void setContactTuning(float hertz, float dampingRatio, float pushOutSpeed)
Configures contact overlap recovery.
Definition World3D.cpp:131
bool isBodyPairCollisionEnabled(Body3D *bodyA, Body3D *bodyB) const
Whether a body pair is permitted by the runtime contact override.
Definition World3D.cpp:358
int queryBodyContacts(int bodyId, int maxPoints)
Compatibility cache adapter over queryBodyContactsOwned for script callers. Results are oriented from...
Definition World3DContacts.cpp:24
void setQueryIgnoredBodyId(int bodyId)
Ignores one stable Body3D ID in subsequent spatial queries; -1 disables.
Definition World3D.cpp:480
int getExplosionResultBodyId(int index) const
Stable Body ID of an affected body, sorted ascending.
int castCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius, float dx, float dy, float dz)
Sweep an arbitrarily oriented capsule through the world. The endpoints are cap centers and d{x,...
Definition World3DQueries.cpp:84
float getMoverNormalZ() const
Representative blocking normal Z from the last move.
Definition World3D.h:791
int getBeginTriggerVisitorShapeTag(int index) const
Visitor Shape Tag of a begin-trigger event.
int getEndContactShapeBTag(int index) const
Shape Tag on stable side B of an end-contact event.
float getClosestDistance() const
Non-negative distance from the target to the closest shape.
Definition World3D.h:707
int getHitBodyBId(int index) const
Stable body ID on side B of a hit.
bool isContinuousCollisionEnabled() const
Whether world-level continuous collision is enabled.
Definition World3D.cpp:122
int getContactPointShapeTag(int index) const
Queried-body Shape Tag of a contact point.
float getHitNormalImpulse(int index) const
Total normal impulse accumulated across all manifolds and substeps.
int querySphere(float x, float y, float z, float radius)
Query shapes overlapping a sphere in world meters.
Definition World3DQueries.cpp:52
int getHitShapeAId(int index) const
Stable Shape ID on side A of a hit.
void setWarmStartingEnabled(bool enabled)
Enables constraint warm starting for stable stacks and joints.
Definition World3D.cpp:150
float getContactPointY(int index) const
World-space contact point Y on the queried body.
float getContactPointNormalY(int index) const
Contact normal Y from queried body toward the other body.
int getBeginContactCount() const
Number of non-sensor contacts that began during the latest step.
Definition World3D.h:817
int getJointStressBodyAId(int index) const
Stable body A ID of a stress event.
float getShapeCastResultNormalZ(int index) const
Contact normal Z of a Shape Cast result.
int getEndContactCount() const
Number of non-sensor contacts that ended during the latest step.
Definition World3D.h:831
int getRayResultShapeId(int index) const
Shape ID of a sorted ray result.
bool isShapePairCollisionEnabled(Shape3D *shapeA, Shape3D *shapeB) const
Whether a shape pair is permitted by the runtime contact override.
Definition World3D.cpp:380
int castCapsuleAll(float ax, float ay, float az, float bx, float by, float bz, float radius, float dx, float dy, float dz, int maxHits)
Collects the nearest maxHits swept-capsule intersections.
Definition World3DQueries.cpp:90
int getBeginTriggerSensorShapeId(int index) const
Sensor shape ID of a begin-trigger event.
int rayCast(float x1, float y1, float z1, float x2, float y2, float z2)
Closest raycast from (x1,y1,z1) to (x2,y2,z2) in meters. Returns hit body id, or -1....
Definition World3DQueries.cpp:20
int getJointStressCount() const
Number of joints exceeding force/torque thresholds in the latest step.
Definition World3D.h:961
float getShapeCastResultY(int index) const
World-space contact point Y of a Shape Cast result.
int explode(float x, float y, float z, float radius, float falloff, float impulsePerArea, int maskBits=-1)
Applies a geometry-aware radial impulse to dynamic convex shapes.
Definition World3D.cpp:156
int getShapeCastTriangleIndex() const
Mesh/height-field triangle index from the latest shape cast, otherwise -1.
Definition World3D.h:720
void setQueryFilter(int categoryBits, int maskBits)
Set category/mask bits for subsequent ray, overlap, cast and mover queries.
Definition World3D.cpp:470
float getMoverDeltaX() const
Resolved translation X from the last moveCapsule call.
Definition World3D.h:781
int getShapeCastMaterialId() const
Surface material ID at the last shape-cast intersection, or zero.
Definition World3D.h:718
float getRayResultFraction(int index) const
Segment fraction in [0,1] of a sorted ray result.
float getBoundsMaxZ() const
Maximum world-space Z covered by current broad-phase bounds.
Definition World3D.cpp:196
int getEndTriggerSensorShapeTag(int index) const
Sensor Shape Tag of an end-trigger event.
void setMoverSlopeLimit(float degrees)
Set maximum walkable slope in degrees, clamped to [0, 89.9].
Definition World3DMover.cpp:14
void setHitEventThreshold(float speed)
Minimum approach speed in m/s required for enabled Shape3D hit events.
Definition World3D.cpp:330
int getBeginContactShapeATag(int index) const
Shape Tag on stable side A of a begin-contact event.
int castBoxAll(float x, float y, float z, float width, float height, float depth, float qx, float qy, float qz, float qw, float dx, float dy, float dz, int maxHits)
Collects the nearest maxHits swept-oriented-box intersections.
Definition World3DQueries.cpp:102
int getContactPointOtherBodyId(int index) const
Other Body ID of a contact point.
int getEndTriggerSensorShapeId(int index) const
Sensor shape ID of an end-trigger event.
Mechanism3D * newCrankSlider(Body3D *frame, Body3D *crank, Body3D *rod, Body3D *slider, float crankAnchorX, float crankAnchorY, float crankAnchorZ, float axisX, float axisY, float axisZ, float crankPinX, float crankPinY, float crankPinZ, float sliderPinX, float sliderPinY, float sliderPinZ, float slideAxisX, float slideAxisY, float slideAxisZ, bool collideConnected=false)
Builds a planar crank-slider from frame, crank, connecting rod and slider bodies.
Definition World3DJoints.cpp:123
float getShapeCastResultNormalX(int index) const
Contact normal X of a Shape Cast result.
int getClosestBodyId() const
Stable body id from the latest closestPoint call, or -1.
Definition World3D.h:689
float getContactPointZ(int index) const
World-space contact point Z on the queried body.
int getBeginContactShapeBTag(int index) const
Shape Tag on stable side B of a begin-contact event.
float getExplosionResultDeltaAngularVelocityY(int index) const
Explosion-induced angular velocity delta Y.
float getExplosionResultDeltaVelocityY(int index) const
Explosion-induced linear velocity delta Y.
float getRayResultX(int index) const
World-space hit point X of a sorted ray result.
int getMemoryByteCount() const
Approximate Box3D world allocation in bytes.
Definition World3D.cpp:217
int getEndTriggerVisitorShapeId(int index) const
Visitor shape ID of an end-trigger event.
int getQueryIgnoredShapeId() const
Stable Shape3D ID currently ignored by queries, or -1.
Definition World3D.h:997
int getEndTriggerVisitorShapeTag(int index) const
Visitor Shape Tag of an end-trigger event.
int getShapeCastBodyId() const
Stable body id from the last shape cast, or -1.
Definition World3D.h:712
float getShapeCastY() const
World-space contact point Y from the last shape cast.
Definition World3D.h:724
int getContactPointShapeId(int index) const
Queried-body Shape ID of a contact point.
float getExplosionResultDeltaAngularVelocityX(int index) const
Explosion-induced angular velocity delta X.
float getShapeCastResultX(int index) const
World-space contact point X of a Shape Cast result.
int queryBox(float x, float y, float z, float width, float height, float depth, float qx, float qy, float qz, float qw)
Query shapes overlapping an oriented box.
Definition World3DQueries.cpp:68
void setMaximumLinearSpeed(float speed)
Sets the finite positive world-wide linear velocity clamp in m/s.
Definition World3D.cpp:144
float getBoundsMinY() const
Minimum world-space Y covered by current broad-phase bounds.
Definition World3D.cpp:188
int getRayHitMaterialId() const
Surface material ID at the last ray intersection, or zero.
Definition World3D.h:528
Mechanism3D * newRatchet(Body3D *frame, Body3D *wheel, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, int direction, float engagementTorque, bool collideConnected=false)
Builds a one-way ratchet around a revolute axis.
Definition World3DJoints.cpp:104
float getJointStressForceZ(int index) const
Constraint force Z of a stress event.
int getShapeCastResultTriangleIndex(int index) const
Mesh/height-field triangle index of a Shape Cast result, otherwise -1.
float getClosestNormalZ() const
Surface-to-target normal Z, or zero for an inside/on-surface target.
Definition World3D.h:705
Joint3D * newFilterJoint(Body3D *bodyA, Body3D *bodyB)
Disables collision between two specific bodies (filter joint).
Definition World3DJoints.cpp:72
int getExplosionResultCount() const
Number of bodies affected by the latest explosion.
Definition World3D.h:250
float getShapeCastResultZ(int index) const
World-space contact point Z of a Shape Cast result.
int getRayHitShapeTag() const
User tag of the shape from the last ray cast, or zero on no hit.
Definition World3D.h:526
Joint3D * newPrismaticJoint(Body3D *bodyA, Body3D *bodyB, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected=false)
Creates a slider whose permitted world-space translation follows axis.
Definition World3DJoints.cpp:190
float getProfileSensorsMs() const
Latest sensor processing time in milliseconds.
Definition World3D.cpp:233
Mechanism3D * newShaft(Body3D *support, Body3D *rotor, float anchorX, float anchorY, float anchorZ, float axisX, float axisY, float axisZ, bool collideConnected=false)
Builds a shaft (support↔rotor revolute) with optional drive motor helpers.
Definition World3DJoints.cpp:90
float getBoundsMinX() const
Minimum world-space X covered by current broad-phase bounds.
Definition World3D.cpp:186
int getAwakeContactCount() const
Contacts processed by the latest collide pass.
Definition World3D.cpp:209
int getHitShapeBTag(int index) const
Shape Tag on side B of a hit.
float getClosestNormalY() const
Surface-to-target normal Y, or zero for an inside/on-surface target.
Definition World3D.h:703
Joint3D * newWheelJoint(Body3D *bodyA, Body3D *bodyB, float anchorX, float anchorY, float anchorZ, float suspensionAxisX, float suspensionAxisY, float suspensionAxisZ, float wheelAxisX, float wheelAxisY, float wheelAxisZ, bool collideConnected=false)
Creates a vehicle wheel joint with independent world suspension and spin axes.
Definition World3DJoints.cpp:216
void setRestitutionThreshold(float speed)
Minimum impact speed that permits material restitution, in m/s.
Definition World3D.cpp:125
Joint3D * newDistanceJoint(Body3D *bodyA, Body3D *bodyB, float anchorAX, float anchorAY, float anchorAZ, float anchorBX, float anchorBY, float anchorBZ, float length, bool collideConnected=false)
Connects two world-space anchor points with a rigid distance constraint.
Definition World3DJoints.cpp:163
float getContactRecycleDistance() const
Current contact-point persistence distance in meters.
Definition World3D.cpp:141
int getHitBodyAId(int index) const
Stable body ID on side A of a hit.
float getJointStressForceX(int index) const
Constraint force X of a stress event.
int queryAABB(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Query shapes overlapping an AABB in meters (min/max corners). Returns match count; read ids with getQ...
Definition World3DQueries.cpp:41
float getContactPointNormalVelocity(int index) const
Pre-solve relative normal velocity; negative means approaching.
void updateFull(float dt, int subStepCount)
Steps with an explicit substep count.
Definition World3DSimulation.cpp:29
int castSphereAll(float x, float y, float z, float radius, float dx, float dy, float dz, int maxHits)
Collects the nearest maxHits swept-sphere intersections.
Definition World3DQueries.cpp:79
int getRayResultShapeTag(int index) const
Shape Tag of a sorted ray result.
int getShapeCastResultShapeTag(int index) const
Shape Tag of a sorted Shape Cast result.
void setContinuousCollisionEnabled(bool enabled)
Enables world-level continuous collision against static geometry.
Definition World3D.cpp:117
void setQueryIgnoredShapeId(int shapeId)
Ignores one stable Shape3D ID in subsequent spatial queries; -1 disables.
Definition World3D.cpp:486
float getShapeCastFraction() const
Translation fraction in [0,1] at the earliest hit.
Definition World3D.h:734
void clearQueryIgnores()
Clears Body and Shape query exclusions without changing layer filtering.
Definition World3D.cpp:492
float getBoundsMaxX() const
Maximum world-space X covered by current broad-phase bounds.
Definition World3D.cpp:192
int getBeginContactShapeBId(int index) const
Shape ID on stable side B of a begin-contact event.
int getEndTriggerSensorBodyId(int index) const
Sensor body ID of an end-trigger event.
int getEndTriggerVisitorBodyId(int index) const
Visitor body ID of an end-trigger event.
int getQueryIgnoredBodyId() const
Stable Body3D ID currently ignored by queries, or -1.
Definition World3D.h:995
int getContactPointCount() const
Number of points cached by queryBodyContacts.
Definition World3D.h:896
float getExplosionResultDeltaAngularVelocityZ(int index) const
Explosion-induced angular velocity delta Z.
float getRayResultNormalX(int index) const
Surface normal X of a sorted ray result.
float getShapeCastResultNormalY(int index) const
Contact normal Y of a Shape Cast result.
float getProfileSolveMs() const
Latest constraint solver time in milliseconds.
Definition World3D.cpp:229
void clearContactEvents()
Clears all contact and trigger buffers before the next step.
Definition World3DContacts.cpp:14
int getJointStressBodyBId(int index) const
Stable body B ID of a stress event.
int getEndContactShapeAId(int index) const
Shape ID on stable side A of an end-contact event.
float getContactPointNormalX(int index) const
Contact normal X from queried body toward the other body.
float getHitNormalY(int index) const
Hit normal Y, pointing from stable side A to B.
float getProfilePairsMs() const
Latest broad-phase pair generation time in milliseconds.
Definition World3D.cpp:225
float getHitApproachSpeed(int index) const
Positive pre-solve approach speed in m/s.
bool hasShapeCastHit() const
Whether the last sphere, capsule, or box cast hit a body.
Definition World3D.h:710
void resetQueryFilter()
Restore the query filter to accept all lower-32-bit categories.
Definition World3D.cpp:475
void setShapePairCollisionEnabled(Shape3D *shapeA, Shape3D *shapeB, bool enabled)
Overrides collision for one live shape pair.
Definition World3D.cpp:366
bool isContactPointPersisted(int index) const
Whether this manifold point existed in the previous step.
Definition World3DContacts.cpp:181
float getMoverNormalX() const
Representative blocking normal X from the last move.
Definition World3D.h:787
float getHitEventThreshold() const
Current significant-hit speed threshold in m/s.
Definition World3D.cpp:333
int getRecycledContactCount() const
Contact points recycled during the latest step.
Definition World3D.cpp:211
int getShapeCastResultMaterialId(int index) const
Surface material ID at a sorted Shape Cast intersection.
int getEndContactBodyBId(int index) const
Body ID on stable side B of an end-contact event.
int getRayResultCount() const
Number of results cached by the latest rayCast or rayCastAll call.
Definition World3D.h:539
float getExplosionResultDeltaVelocityZ(int index) const
Explosion-induced linear velocity delta Z.
int rayCastAll(float x1, float y1, float z1, float x2, float y2, float z2, int maxHits)
Collects the nearest maxHits ray intersections, sorted by fraction then Shape ID.
Definition World3DQueries.cpp:36
Body3D * newBody(const std::string &bodyType, float x, float y, float z)
Creates a body in meter-space units.
Definition World3D.cpp:422
float getHitNormalZ(int index) const
Hit normal Z, pointing from stable side A to B.
int getBeginTriggerSensorShapeTag(int index) const
Sensor Shape Tag of a begin-trigger event.
float getBoundsMaxY() const
Maximum world-space Y covered by current broad-phase bounds.
Definition World3D.cpp:194
void setContactRecycleDistance(float distance)
Sets contact-point persistence distance in meters; zero disables recycling.
Definition World3D.cpp:136
float getRayResultNormalZ(int index) const
Surface normal Z of a sorted ray result.
int getShapeCastResultBodyId(int index) const
Body ID of a sorted Shape Cast result.
int getHitShapeATag(int index) const
Shape Tag on side A of a hit.
bool moveCapsule(float ax, float ay, float az, float bx, float by, float bz, float radius, float dx, float dy, float dz)
Move a capsule with continuous collision and multi-plane sliding. Existing penetration is recovered b...
Definition World3DMover.cpp:20
float getJointStressTorqueY(int index) const
Constraint torque Y of a stress event.
int getJointStressJointId(int index) const
Stable Joint3D ID of a stress event.
int getBeginContactBodyAId(int index) const
Body ID on stable side A of a begin-contact event.
int getBeginTriggerVisitorBodyId(int index) const
Visitor body ID of a begin-trigger event.
float getJointStressTorqueZ(int index) const
Constraint torque Z of a stress event.
int getMoverIterations() const
Number of outer solver passes used by the last move.
Definition World3D.h:795
float getRayResultY(int index) const
World-space hit point Y of a sorted ray result.
int getShapeCastResultCount() const
Number of results cached by the latest single or multi Shape Cast.
Definition World3D.h:736
int getMoverPlaneCount() const
Number of collision planes considered during the last move.
Definition World3D.h:793
float getJointStressTorqueX(int index) const
Constraint torque X of a stress event.
int getContactPointOtherShapeTag(int index) const
Other Shape Tag of a contact point.
int getRayResultBodyId(int index) const
Body ID of a sorted ray result.
int getRayResultMaterialId(int index) const
Surface material ID at a sorted ray intersection.
float getContactPointNormalZ(int index) const
Contact normal Z from queried body toward the other body.
float getMoverGroundDot() const
Largest dot product between mover up and a contact normal.
Definition World3D.h:803
bool isMoverGrounded() const
True when the last move touched a walkable plane.
Definition World3D.h:801
float getRayResultZ(int index) const
World-space hit point Z of a sorted ray result.
Joint2D * newDistanceJoint(Body *bodyA, Body *bodyB, float anchorAX, float anchorAY, float anchorBX, float anchorBY, float lengthPixels, bool collideConnected=false)
Connects two pixel-space anchors with a distance constraint.
Definition WorldJoints2D.cpp:78
Joint2D * newWheelJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, float axisX, float axisY, bool collideConnected=false)
Creates a wheel joint with a pixel-space suspension axis.
Definition WorldJoints2D.cpp:109
int getEndTriggerCount() const
Sensor/visitor end overlaps collected during the last step.
Definition World.h:383
int getEndTriggerSensorBodyId(int index) const
Definition World.cpp:703
void update(float dt)
Steps the simulation by dt seconds (5 velocity / 2 position iterations).
Definition World.cpp:394
int queryAABB(float x, float y, float w, float h)
Query fixtures overlapping an axis-aligned box in pixel space (x,y,w,h). Returns match count; read id...
Definition World.cpp:814
float getImpactNormalY(int index) const
Definition World.cpp:743
int getBeginTriggerCount() const
Sensor/visitor begin overlaps collected during the last step (2D parity with World3D).
Definition World.h:377
Joint2D * newWeldJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, bool collideConnected=false)
Welds two bodies at a shared pixel-space anchor.
Definition WorldJoints2D.cpp:102
std::string getBeginContactFixtureATag(int index) const
Definition World.cpp:660
std::string getEndContactFixtureATag(int index) const
Definition World.cpp:676
int getBeginTriggerSensorBodyId(int index) const
Definition World.cpp:691
void drawDebug(graphics::Graphics *gfx)
Optional: draw fixture AABBs via Graphics::drawSolidRect.
Definition WorldDebugDraw.cpp:117
int getEndContactBodyBId(int index) const
Definition World.cpp:672
int getBeginContactBodyBId(int index) const
Definition World.cpp:656
std::string getEndTriggerSensorFixtureTag(int index) const
Definition World.cpp:709
Joint2D * newPrismaticJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, float axisX, float axisY, bool collideConnected=false)
Creates a prismatic slider along a pixel-space axis.
Definition WorldJoints2D.cpp:94
int getEndTriggerVisitorBodyId(int index) const
Definition World.cpp:706
void setGravity(float gx, float gy)
Sets the world gravity vector in pixels/s^2.
Definition World.cpp:447
int getEndContactBodyAId(int index) const
Definition World.cpp:668
float getRayHitFraction() const
Fraction along the segment [0,1] of the closest hit.
Definition World.h:355
Joint2D * newRevoluteJoint(Body *bodyA, Body *bodyB, float anchorX, float anchorY, bool collideConnected=false)
Creates a revolute hinge at a shared pixel-space anchor.
Definition WorldJoints2D.cpp:87
std::string getBeginTriggerSensorFixtureTag(int index) const
Definition World.cpp:697
float getImpactNormalX(int index) const
Definition World.cpp:739
float getImpactRelativeNormalSpeed(int index) const
Definition World.cpp:747
Body * newBody(const std::string &bodyType, float x, float y)
Creates a body in pixel-space units.
Definition World.cpp:478
std::string getBeginTriggerVisitorFixtureTag(int index) const
Definition World.cpp:700
Mechanism2D * newCrankSlider(Body *frame, Body *crank, Body *rod, Body *slider, float crankAnchorX, float crankAnchorY, float crankPinX, float crankPinY, float sliderPinX, float sliderPinY, float slideAxisX, float slideAxisY, bool collideConnected=false)
Builds a planar crank-slider from frame, crank, connecting rod and slider bodies.
Definition WorldJoints2D.cpp:156
int getBeginContactBodyAId(int index) const
Definition World.cpp:652
std::string getEndTriggerVisitorFixtureTag(int index) const
Definition World.cpp:712
Joint2D * newGearJoint(Joint2D *joint1, Joint2D *joint2, float ratio)
Creates a gear joint that couples two revolute or prismatic joints.
Definition WorldJoints2D.cpp:123
Mechanism2D * newRatchet(Body *frame, Body *wheel, float anchorX, float anchorY, int direction, float engagementTorque, bool collideConnected=false)
Builds a one-way ratchet around a revolute hinge.
Definition WorldJoints2D.cpp:141
int getBeginTriggerVisitorBodyId(int index) const
Definition World.cpp:694
float getImpactNormalImpulse(int index) const
Definition World.cpp:751
std::string getEndContactFixtureBTag(int index) const
Definition World.cpp:680
int rayCast(float x1, float y1, float x2, float y2)
Closest raycast in pixel space from (x1,y1) to (x2,y2). Returns hit body id, or -1....
Definition World.cpp:769
float getImpactTangentImpulse(int index) const
Definition World.cpp:755
std::string getBeginContactFixtureBTag(int index) const
Definition World.cpp:664
void updateFull(float dt, int velocityIterations, int positionIterations)
Steps with explicit iteration counts.
Definition World.cpp:396
void clearContactEvents()
Clears collected begin/end contact and impact event buffers.
Definition World.cpp:760
std::string getImpactFixtureATag(int index) const
Definition World.cpp:723
std::string getImpactFixtureBTag(int index) const
Definition World.cpp:727
Joint2D * newMotorJoint(Body *bodyA, Body *bodyB, bool collideConnected=false)
Creates a motor joint that drives relative pose between bodies.
Definition WorldJoints2D.cpp:117
Mechanism2D * newShaft(Body *support, Body *rotor, float anchorX, float anchorY, bool collideConnected=false)
Builds a shaft (support↔rotor revolute) with optional drive motor helpers.
Definition WorldJoints2D.cpp:130
@ Exception
const Value * field(const Value::Object &object, std::string_view name)
Borrow an optional field only during the current synchronous codec call. @ownership Object owns the r...
Definition WorldSnapshotParsing.cpp:17
Result< DistanceField3D > distanceFieldFromSdfField3DBlob(const SdfField3DBlob &blob)
Build a DistanceField3D from a portable VertexGrid blob. @cost Allocates the destination grid and cop...
Definition DistanceField3DSdf.cpp:85
void exposeCoupling3DBindings(ssq::Table &table)
Register owning transmission Result factories; table is borrowed on the VM owner thread during this c...
Definition Coupling3DBindings.cpp:96
ssq::Table projectSweepContactImpulse(World3D *world, const ssq::Object &event, PhysicsVector3D impulse, PhysicsVector3D point)
Project an explicit contact impulse through the canonical script Result boundary.
Definition WorldSphereSweepScript.cpp:46
Result< void > beginTerrainLoadGravity(TerrainLoadGravityState *state, Body3D *body, bool terrainFound)
Begin monitoring a body when a containing terrain scene exists.
Definition TerrainLoadGravity.cpp:10
void exposeForceBindings(ssq::Table &table)
Register force model value classes and Result-projected functions. @ownership Table is borrowed for r...
Definition ForceBindings.cpp:352
void exposeJoint2DBindings(ssq::Table &table)
Register owning Joint2D Result factories; borrows table during this call on the VM owner thread only.
Definition Joint2DBindings.cpp:133
Result< bool > advanceTerrainLoadGravity(TerrainLoadGravityState *state, Body3D *body, bool terrainLoaded, float deltaSeconds, float activationDelay)
Advance terrain-load waiting and restore gravity after the configured delay.
Definition TerrainLoadGravity.cpp:28
void registerPhysicsCapabilities()
Registers physics capabilities.
Definition PhysicsCapabilities.cpp:82
Result< SdfField3DBlob > sdfField3DBlobFromDistanceField(const DistanceField3D &field)
Copy a DistanceField3D into the portable VertexGrid blob. @cost Copies every distance sample once.
Definition DistanceField3DSdf.cpp:64
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
Definition SquirrelBinding.cpp:524
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
Result< Value > valueFromSquirrel(HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options)
Convert one Squirrel value into the canonical owning Value tree.
Definition SquirrelBinding.cpp:412
@ InvalidArgument
Result< Value > encodeSdfField3DBlob(const SdfField3DBlob &blob)
Encode a validated SDF blob to a Value object. @cost Copies the distance sample buffer into the Value...
Definition SdfField3D.cpp:35
Result< SdfField3DBlob > decodeSdfField3DBlob(const Value &value)
Decode a Value object into an owning SDF blob. @cost Allocates and copies the distance sample buffer ...
Definition SdfField3D.cpp:54