@threlte/rapier 3.0.0-next.3 → 3.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,7 +7,7 @@ import { parseRigidBodyType } from '../../lib/parseRigidBodyType';
|
|
|
7
7
|
import { setParentRigidbodyObject } from '../../lib/rigidBodyObjectContext';
|
|
8
8
|
import { useCreateEvent } from '../../lib/useCreateEvent';
|
|
9
9
|
const { world, rapier, addRigidBodyToContext, removeRigidBodyFromContext } = useRapier();
|
|
10
|
-
let { linearVelocity, angularVelocity, type = 'dynamic', canSleep = true, gravityScale = 1, ccd = false, angularDamping = 0, linearDamping = 0, lockRotations = false, lockTranslations = false, enabledRotations = [true, true, true], enabledTranslations = [true, true, true], dominance = 0, enabled = true, userData = {}, rigidBody = $bindable(), oncreate, oncollisionenter, oncollisionexit, oncontact, onsensorenter, onsensorexit, onsleep, onwake } = $props();
|
|
10
|
+
let { linearVelocity, angularVelocity, type = 'dynamic', canSleep = true, gravityScale = 1, ccd = false, angularDamping = 0, linearDamping = 0, lockRotations = false, lockTranslations = false, enabledRotations = [true, true, true], enabledTranslations = [true, true, true], dominance = 0, enabled = true, userData = {}, rigidBody = $bindable(), oncreate, oncollisionenter, oncollisionexit, oncontact, onsensorenter, onsensorexit, onsleep, onwake, children } = $props();
|
|
11
11
|
/**
|
|
12
12
|
* Every RigidBody receives and forwards collision-related events
|
|
13
13
|
*/
|
|
@@ -114,5 +114,5 @@ onDestroy(() => {
|
|
|
114
114
|
</script>
|
|
115
115
|
|
|
116
116
|
<SceneGraphObject {object}>
|
|
117
|
-
|
|
117
|
+
{@render children?.({ rigidBody: rigidBodyInternal })}
|
|
118
118
|
</SceneGraphObject>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { onDestroy, setContext, tick } from 'svelte';
|
|
2
2
|
import { useFrameHandler } from '../../hooks/useFrameHandler';
|
|
3
3
|
import { createRapierContext } from '../../lib/createRapierContext';
|
|
4
|
-
let { gravity = [0, -9.81, 0], rawIntegrationParameters, rawIslands, rawBroadPhase, rawNarrowPhase, rawBodies, rawColliders, rawImpulseJoints, rawMultibodyJoints, rawCCDSolver, rawQueryPipeline, rawPhysicsPipeline, rawSerializationPipeline, rawDebugRenderPipeline, stage } = $props();
|
|
4
|
+
let { gravity = [0, -9.81, 0], rawIntegrationParameters, rawIslands, rawBroadPhase, rawNarrowPhase, rawBodies, rawColliders, rawImpulseJoints, rawMultibodyJoints, rawCCDSolver, rawQueryPipeline, rawPhysicsPipeline, rawSerializationPipeline, rawDebugRenderPipeline, stage, children } = $props();
|
|
5
5
|
const rapierContext = createRapierContext({ x: gravity[0], y: gravity[1], z: gravity[2] }, rawIntegrationParameters, rawIslands, rawBroadPhase, rawNarrowPhase, rawBodies, rawColliders, rawImpulseJoints, rawMultibodyJoints, rawCCDSolver, rawQueryPipeline, rawPhysicsPipeline, rawSerializationPipeline, rawDebugRenderPipeline);
|
|
6
6
|
setContext('threlte-rapier-context', rapierContext);
|
|
7
7
|
$effect.pre(() => {
|
|
@@ -16,4 +16,4 @@ onDestroy(async () => {
|
|
|
16
16
|
});
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
{@render children?.()}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { WorldProps } from './World.svelte';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: WorldProps
|
|
5
|
-
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
|
6
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
|
7
|
-
}) | undefined;
|
|
8
|
-
};
|
|
4
|
+
props: WorldProps;
|
|
9
5
|
events: {
|
|
10
6
|
[evt: string]: CustomEvent<any>;
|
|
11
7
|
};
|
|
12
|
-
slots: {
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
8
|
+
slots: {};
|
|
15
9
|
};
|
|
16
10
|
export type InnerWorldProps = typeof __propDef.props;
|
|
17
11
|
export type InnerWorldEvents = typeof __propDef.events;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threlte/rapier",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.4",
|
|
4
4
|
"author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"description": "Components and hooks to use the Rapier physics engine in Threlte",
|
|
6
7
|
"devDependencies": {
|
|
7
8
|
"@dimforge/rapier3d-compat": "^0.12.0",
|
|
8
9
|
"@sveltejs/adapter-auto": "^3.2.0",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"type-fest": "^4.15.0",
|
|
31
32
|
"typescript": "^5.4.5",
|
|
32
33
|
"vite": "^5.2.8",
|
|
33
|
-
"@threlte/core": "8.0.0-next.
|
|
34
|
+
"@threlte/core": "8.0.0-next.8"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"@dimforge/rapier3d-compat": ">=0.12",
|
|
@@ -38,6 +39,24 @@
|
|
|
38
39
|
"three": ">=0.152"
|
|
39
40
|
},
|
|
40
41
|
"type": "module",
|
|
42
|
+
"keywords": [
|
|
43
|
+
"threlte",
|
|
44
|
+
"rapier",
|
|
45
|
+
"svelte",
|
|
46
|
+
"three",
|
|
47
|
+
"three.js",
|
|
48
|
+
"3d",
|
|
49
|
+
"physics"
|
|
50
|
+
],
|
|
51
|
+
"homepage": "https://threlte.xyz",
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "https://github.com/threlte/threlte.git",
|
|
55
|
+
"directory": "packages/rapier"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/threlte/threlte/issues"
|
|
59
|
+
},
|
|
41
60
|
"exports": {
|
|
42
61
|
".": {
|
|
43
62
|
"types": "./dist/index.d.ts",
|