Skip to content

Commit 40f18ce

Browse files
committed
Update deps and example
1 parent ce702df commit 40f18ce

21 files changed

+975
-1200
lines changed

.eslintrc.json

Lines changed: 0 additions & 76 deletions
This file was deleted.

.github/workflows/eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install Node.js
2727
uses: actions/setup-node@v3
2828
with:
29-
node-version: 18.16.0
29+
node-version: 22.14.0
3030
cache: 'npm'
3131

3232
- name: Install Modules

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Node.js
2222
uses: actions/setup-node@v3
2323
with:
24-
node-version: 18.16.0
24+
node-version: 22.14.0
2525
cache: 'npm'
2626

2727
- name: Get Package Version

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install Node.js
2727
uses: actions/setup-node@v3
2828
with:
29-
node-version: 18.16.0
29+
node-version: 22.14.0
3030
cache: 'npm'
3131

3232
- name: Install Modules

CODE_OF_CONDUCT.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Code of Conduct
2+
3+
We pledge to act and interact in ways that contribute to an open and healthy community.
4+
5+
## Our Standards
6+
7+
Examples of unacceptable behavior:
8+
9+
* The use of sexualized language or imagery
10+
* Trolling, insulting or derogatory comments
11+
* Public or private harassment
12+
* Publishing others' private information
13+
* Other unprofessional conduct
14+
15+
## Enforcement
16+
17+
Community leaders will remove, edit, or reject
18+
contributions that are not aligned to this Code of Conduct.

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contributing
2+
3+
Bugs and enhancements are tracked as GitHub issues.
4+
5+
## Issues
6+
7+
* Use a clear and descriptive title.
8+
* Describe the desired enhancement / problem.
9+
* Provide examples to demonstrate the issue.
10+
* If the problem involves a crash, provide its trace log.
11+
12+
## Pull Requests
13+
14+
* Do not include issue numbers in the PR title.
15+
* Commits use the present tense (`"Add feature"` not `"Added feature"`).
16+
* Commits use the imperative mood (`"Move cursor to..."` not `"Moves cursor to..."`).
17+
* File System
18+
* Prefer kebab-lowercase (`my-dir/example-file-name.js`).
19+
* Place an empty `.keep` file to keep an empty directory.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Luis Blanco
3+
Copyright (c) 2025 Luis Blanco
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,44 @@ Bullet physics plugin for Node.js 3D Core
1414

1515
![Example](examples/screenshot.jpg)
1616

17+
This plugin provides the `Shape` class to simplify the common use cases with Three.js and
18+
Bullet Physics addon.
1719

18-
```typescript
20+
* Can display debug shapes.
21+
* Updates mesh pose from physics engine.
22+
* Removes meshes when the body is destroyed.
23+
* `Shape` extends `Body` and works with `scene.hit()/scene.trace()`.
24+
25+
```ts
1926
import * as three from 'three';
2027
import { init, addThreeHelpers } from '3d-core-raub';
21-
import { init as initBullet } from '3d-qml-raub';
28+
import { init as initBullet } from '3d-bullet-raub';
2229

23-
// Standard Node3D init
24-
const {
25-
doc, Image: Img, gl,
26-
} = init({
27-
isGles3: true, isWebGL2: true, autoEsc: true,
28-
});
30+
const { gl, loop, Screen } = init();
2931
addThreeHelpers(three, gl);
32+
const { scene, Shape } = initBullet({ three });
33+
34+
const screen = new Screen({ three });
35+
36+
const plane = new Shape({
37+
sceneThree: screen.scene,
38+
color: 0xface8d,
39+
type: 'plane',
40+
debug: 'solid',
41+
});
42+
43+
const box = new Shape({
44+
sceneThree: screen.scene,
45+
pos: [0, 10, 0], // use { xyz } or [xyz]
46+
mass: 3,
47+
debug: 'solid',
48+
color: 0xbeefed,
49+
size: { x: 3, y: 2, z: 1 }, // use { xyz } or [xyz]
50+
});
3051

31-
// Initialize Bullet and fetch the helpers
32-
const {
33-
Box, Ball, Roll, Caps, Scene, Body, bullet,
34-
} = initBullet({
35-
three,
52+
loop(() => {
53+
scene.update();
54+
screen.draw();
3655
});
3756
```
3857

SECURITY.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Latest major version.
6+
7+
## Reporting a Vulnerability
8+
9+
10+
11+
Telegram: [luisblanco_0](https://t.me/luisblanco_0)

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
module.exports = [
4+
{
5+
ignores: ['examples/qt-calqlatr/calqlatr/content/calculator.js']
6+
},
7+
...require('addon-tools-raub/utils/eslint-common'),
8+
];

0 commit comments

Comments
 (0)