64-bit hashes (#126)
- ContactEvent sample - Improved shadows - #120 - Triangle collision fixes
This commit is contained in:
parent
3fc20f5b45
commit
f42be210a2
49 changed files with 19835 additions and 17544 deletions
4
docs/deploy_docs.sh
Normal file
4
docs/deploy_docs.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copies documentation to blog
|
||||
cp -R build/docs/html/. ../blog/public/documentation3d/
|
||||
18
docs/faq.md
18
docs/faq.md
|
|
@ -44,6 +44,24 @@ for orientation and 3x3 inertia tensors for rotational dynamics. If you come acr
|
|||
understand, please read about it on Wikipedia. Visit this [page](https://box2d.org/publications/) if you want a deeper
|
||||
knowledge of the algorithms used in Box3D.
|
||||
|
||||
### Working with Unreal
|
||||
|
||||
You can use Box3D in Unreal as a plug-in. Here is the module file I use:
|
||||
|
||||
[Box3D module](https://gist.github.com/erincatto/6f08df5f1e6e9a79fb4be6298a3e1125)
|
||||
|
||||
Unreal uses centimeters as units while Box3D has tolerances tuned for meters. You can either scale dimensions you send and recieve from Box3D or you can use this to set the length units:
|
||||
|
||||
```c
|
||||
b3SetLengthUnitsPerMeter(100.0f);
|
||||
```
|
||||
|
||||
This doesn't scale the units. Instead it scales the tolerances used internally in Box3D to be more appropriate for centimeters.
|
||||
|
||||
Another issue is that Box3D is right-handed while Unreal is left-handed. Box3D has way too much math for it to be reasonable to support a left-handed option. However, it doesn't matter. In practice you don't need to do any conversions. Box3D will run in a mirrored world and the outputs from Box3D are fully compatible with the Unreal coordinates.
|
||||
|
||||
I would just be careful about using Box3D math functions like `b3Cross` and expecting it to give the same result as the Unreal cross product.
|
||||
|
||||
## API
|
||||
|
||||
### What units does Box3D use?
|
||||
|
|
|
|||
|
|
@ -42,11 +42,13 @@ printf("Box3D version %d.%d.%d\n", version.major, version.minor, version.revisio
|
|||
```
|
||||
|
||||
## Vector Math
|
||||
|
||||
Box3D includes a vector math library covering types `b3Vec3`, `b3Quat`, `b3Transform`,
|
||||
`b3Matrix3`, and `b3AABB`. The library is designed to suit the internal needs of Box3D
|
||||
and its interface. All members are exposed, so you can use them freely in your application.
|
||||
|
||||
### b3Vec3
|
||||
|
||||
Three-component float vector with fields `x`, `y`, `z`. Useful constants and operations:
|
||||
|
||||
```c
|
||||
|
|
@ -64,6 +66,7 @@ b3Vec3 q = b3Lerp(a, b, 0.5f); // linear interpolation
|
|||
```
|
||||
|
||||
### b3Quat
|
||||
|
||||
Unit quaternion representing orientation. Stored as a vector part `q.v` (x, y, z) and a
|
||||
scalar part `q.s`. The identity quaternion is `b3Quat_identity`.
|
||||
|
||||
|
|
@ -103,6 +106,7 @@ Because orientation in 3D is three-dimensional, there is no single scalar angle
|
|||
in 2D. Always work with the full quaternion or the derived matrix.
|
||||
|
||||
### b3Transform
|
||||
|
||||
A rigid transform: a position vector `t.p` (`b3Vec3`) combined with an orientation `t.q`
|
||||
(`b3Quat`). The identity transform is `b3Transform_identity`.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue