summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/ephysics_body_materials.h
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-04 22:39:42 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-04 22:39:42 +0000
commit0bdec6725538665680ba77a84b21a745c7462380 (patch)
treec73adc53ab94baa2dc29a7de3b8a8763c60f1db9 /legacy/ephysics/src/lib/ephysics_body_materials.h
parentf0b85f701d2c55ad70c37e85b57abb5819ceecf5 (diff)
ephysics: support body material
Using material_set it will be easier to set density, friction and restitution to a body, simulating properties of the selected material. SVN revision: 77462
Diffstat (limited to 'legacy/ephysics/src/lib/ephysics_body_materials.h')
-rw-r--r--legacy/ephysics/src/lib/ephysics_body_materials.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_body_materials.h b/legacy/ephysics/src/lib/ephysics_body_materials.h
new file mode 100644
index 0000000000..993a0b116b
--- /dev/null
+++ b/legacy/ephysics/src/lib/ephysics_body_materials.h
@@ -0,0 +1,37 @@
1#ifndef _EPHYSICS_BODY_MATERIALS_H
2#define _EPHYSICS_BODY_MATERIALS_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8typedef struct _EPhysics_Body_Material_Props EPhysics_Body_Material_Props;
9struct _EPhysics_Body_Material_Props {
10 EPhysics_Body_Material material;
11 int density;
12 double friction;
13 double restitution;
14};
15
16const EPhysics_Body_Material_Props ephysics_material_props [] = {
17 {EPHYSICS_BODY_MATERIAL_CUSTOM, 1.0, 0.0, 0.0},
18 {EPHYSICS_BODY_MATERIAL_CONCRETE, EPHYSICS_BODY_DENSITY_CONCRETE,
19 EPHYSICS_BODY_FRICTION_CONCRETE, EPHYSICS_BODY_RESTITUTION_CONCRETE},
20 {EPHYSICS_BODY_MATERIAL_IRON, EPHYSICS_BODY_DENSITY_IRON,
21 EPHYSICS_BODY_FRICTION_IRON, EPHYSICS_BODY_RESTITUTION_IRON},
22 {EPHYSICS_BODY_MATERIAL_PLASTIC, EPHYSICS_BODY_DENSITY_PLASTIC,
23 EPHYSICS_BODY_FRICTION_PLASTIC, EPHYSICS_BODY_RESTITUTION_PLASTIC},
24 {EPHYSICS_BODY_MATERIAL_POLYSTYRENE, EPHYSICS_BODY_DENSITY_POLYSTYRENE,
25 EPHYSICS_BODY_FRICTION_POLYSTYRENE,
26 EPHYSICS_BODY_RESTITUTION_POLYSTYRENE},
27 {EPHYSICS_BODY_MATERIAL_RUBBER, EPHYSICS_BODY_DENSITY_RUBBER,
28 EPHYSICS_BODY_FRICTION_RUBBER, EPHYSICS_BODY_RESTITUTION_RUBBER},
29 {EPHYSICS_BODY_MATERIAL_WOOD, EPHYSICS_BODY_DENSITY_WOOD,
30 EPHYSICS_BODY_FRICTION_WOOD, EPHYSICS_BODY_RESTITUTION_WOOD}
31};
32
33#ifdef __cplusplus
34}
35#endif
36
37#endif