Commit Graph

4538 Commits

Author SHA1 Message Date
bjorn d9a2166b45 Use lua_error return value less;
If a hypothetical Lua implementation declared these functions as
noreturn for better codegen, it might also want to change the return
type to void for better compiler compatibility.
2024-05-11 23:49:09 -07:00
bjorn a7d9df1dc2 Texture:getLabel; Shader:getLabel; 2024-05-11 23:33:32 -07:00
bjorn 875d9d6f76 Remove unneeded Lua includes;
Anything that includes api.h gets Lua includes now.
2024-05-11 22:59:51 -07:00
bjorn 9403f51ca8 Merge branch 'stable' into dev 2024-05-10 20:02:25 -07:00
bjorn 2588d1a85a Fix Font:getLines with multicolor strings; 2024-05-10 20:01:42 -07:00
bjorn c45f66af89 Deprecate World:destroy;
World:release can be used instead.
2024-05-10 17:03:12 -07:00
bjorn 6a958a45bb Ignore Collider:setKinematic if Collider's shape must be static; 2024-05-10 16:16:24 -07:00
bjorn c657441f88 Use JPH_Shape_MustBeStatic to detect if Collider should be static;
This is better because it will also make the collider static if it has a
compound shape with a mesh collider in it.
2024-05-10 16:04:08 -07:00
bjorn 722a947d5e Fix warnings; 2024-05-10 16:03:56 -07:00
bjorn 2ffa810c06 Fix Collider/Shape/Joint:setUserData with zero args; 2024-05-10 15:25:54 -07:00
bjorn 60c5472cba Details; 2024-05-10 00:27:00 -07:00
Bjorn 4c6083e87c
Merge pull request #772 from jmiskovic/add/joint-limit-assertions
Assert the input range in joint limits setters
2024-05-10 00:26:12 -07:00
Josip Miskovic 09f106d435 Assert the input range in joint limits setters
The Jolt already asserts these values, which results in crash instead
of helpful error message.

For cone joint the value out of range will now throw error instead of
silent clamp.
2024-05-10 09:11:45 +02:00
bjorn 6187ea19d0 Work around weird GCC warning; 2024-05-09 21:11:36 -07:00
Bjorn 4fce7240bc
Merge pull request #771 from jmiskovic/fix/joint-typecheck
Fix remaining assertions of the Joint type
2024-05-09 12:56:28 -07:00
Josip Miskovic 4c0c8f358d Fix remaining assertions of the Joint type 2024-05-09 16:22:27 +02:00
Josip Miskovic c383fe3818 Fix creation of flat physics terrain
There is not enough samples in 2x2 vertices, because the physics_jolt
additionally divides scale with n - 1.
2024-05-09 14:17:36 +02:00
bjorn 010ffee736 Fix Shape:getInertia; 2024-05-03 13:34:24 -07:00
bjorn 979dd044d8 Add contact callback and Contact object; 2024-05-03 13:28:47 -07:00
bjorn 836189edbe New mass API;
- All of the mass properties have regular getters/setters
  - :get/setMass
  - :get/setInertia
  - :get/setCenterOfMass
- You can use nil for any of the setters to set the mass property to an
  "automatic" value, computed from the shape and/or other overridden
  mass properties.
- If you override the mass properties, we assume you know what you're
  doing and don't try to be sneaky and auto-update downstream values.
  So changing the mass or center of mass doesn't auto-scale the inertia.
- If you change the shape (or enabled axes), mass data gets reset.
- You can use :resetMass to reset all 3 mass properties at once.  It's
  also useful if something about the underlying shape changed.
2024-05-02 23:39:55 -07:00
bjorn c23a0c04c0 Add velocitySteps/positionSteps options to newWorld; 2024-05-02 18:13:14 -07:00
bjorn fcd8230e94 Add lock around activation listener; 2024-05-01 20:08:04 -07:00
bjorn 3733485433 Fixed timestep physics interpolation; 2024-05-01 20:08:03 -07:00
bjorn d42915fb00 Collider shape is required; newCollider takes shape last; 2024-05-01 20:05:25 -07:00
bjorn 68aaba9f09 Shape:getMass/Inertia/Center/MassData; 2024-04-30 16:37:55 -07:00
bjorn ce217ddbb1 Shape:get/setDensity; 2024-04-30 16:21:54 -07:00
bjorn a8f8f157a7 Rename World:collide to :collideShape; 2024-04-30 15:33:12 -07:00
bjorn 186a085ada Shape:getVolume; 2024-04-30 04:56:47 -07:00
bjorn 30c51f240b World:collide; 2024-04-30 03:24:49 -07:00
bjorn f25b3beaaf Queries and raycasts work more similarly;
They return the result if no callback is given.
2024-04-30 02:44:15 -07:00
bjorn 4858f32164 Tag filtering; 2024-04-30 01:53:43 -07:00
bjorn 1d502579b2 More tag stuff; 2024-04-29 17:43:41 -07:00
bjorn 563d6671d1 World tag improvements; 2024-04-28 12:43:13 -07:00
bjorn 828e039f8d Mesh/terrain colliders correctly default to static; 2024-04-28 12:08:16 -07:00
bjorn 61fd59d1a2 Add missing ConeJoint bindings; 2024-04-28 11:53:38 -07:00
bjorn 90ed67c0d5 Misc cleanup; 2024-04-28 11:53:38 -07:00
bjorn 8c52cf5b01 Collider:getEnabledAxes works better; 2024-04-28 11:53:38 -07:00
bjorn e9a3db6250 ConeJoint; 2024-04-28 11:53:38 -07:00
bjorn ea9e512d9a Fix ConvexShape methods; 2024-04-28 11:53:38 -07:00
bjorn 1115029fe0 Add more settings to newWorld; 2024-04-28 11:53:38 -07:00
bjorn 4dbcc15cef Add ConvexShape methods; 2024-04-28 11:53:38 -07:00
bjorn a0bbc68be5 Joint colliders are optional;
One of the colliders can be nil to fix the joint to the world.

This currently crashes JoltC.
2024-04-27 14:23:39 -07:00
bjorn 1865cf8591 Add Collider:get/setType;
Deprecates Collider:is/setKinematic.
2024-04-27 13:37:31 -07:00
bjorn 9b3ace7094 WIP Collider:get/setEnabledAxes; 2024-04-27 13:37:31 -07:00
bjorn b6b13deea6 Call NotifyShapeChanged when collider shape changes;
Jolt says we have to do this if the collider has joints.  um...ok...
2024-04-27 13:37:31 -07:00
bjorn ee76f3418a World:shapecast; 2024-04-27 13:37:31 -07:00
bjorn 5f6880f8ef Raycast adjustments; 2024-04-27 13:37:31 -07:00
bjorn 115f2e24b2 New raycast implementation; 2024-04-27 13:37:31 -07:00
bjorn a1ea0eaceb World:queryBox/querySphere use broad phase queries; 2024-04-27 13:37:31 -07:00
bjorn 37be4a2909 Query callback use better function pointer syntax; 2024-04-26 17:17:52 -07:00