aboutsummaryrefslogtreecommitdiffstats
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
parentephysics: add some material constants (diff)
downloadefl-0bdec6725538665680ba77a84b21a745c7462380.tar.gz
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 @@
+#ifndef _EPHYSICS_BODY_MATERIALS_H
+#define _EPHYSICS_BODY_MATERIALS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _EPhysics_Body_Material_Props EPhysics_Body_Material_Props;
+struct _EPhysics_Body_Material_Props {
+ EPhysics_Body_Material material;
+ int density;
+ double friction;
+ double restitution;
+};
+
+const EPhysics_Body_Material_Props ephysics_material_props [] = {
+ {EPHYSICS_BODY_MATERIAL_CUSTOM, 1.0, 0.0, 0.0},
+ {EPHYSICS_BODY_MATERIAL_CONCRETE, EPHYSICS_BODY_DENSITY_CONCRETE,
+ EPHYSICS_BODY_FRICTION_CONCRETE, EPHYSICS_BODY_RESTITUTION_CONCRETE},
+ {EPHYSICS_BODY_MATERIAL_IRON, EPHYSICS_BODY_DENSITY_IRON,
+ EPHYSICS_BODY_FRICTION_IRON, EPHYSICS_BODY_RESTITUTION_IRON},
+ {EPHYSICS_BODY_MATERIAL_PLASTIC, EPHYSICS_BODY_DENSITY_PLASTIC,
+ EPHYSICS_BODY_FRICTION_PLASTIC, EPHYSICS_BODY_RESTITUTION_PLASTIC},
+ {EPHYSICS_BODY_MATERIAL_POLYSTYRENE, EPHYSICS_BODY_DENSITY_POLYSTYRENE,
+ EPHYSICS_BODY_FRICTION_POLYSTYRENE,
+ EPHYSICS_BODY_RESTITUTION_POLYSTYRENE},
+ {EPHYSICS_BODY_MATERIAL_RUBBER, EPHYSICS_BODY_DENSITY_RUBBER,
+ EPHYSICS_BODY_FRICTION_RUBBER, EPHYSICS_BODY_RESTITUTION_RUBBER},
+ {EPHYSICS_BODY_MATERIAL_WOOD, EPHYSICS_BODY_DENSITY_WOOD,
+ EPHYSICS_BODY_FRICTION_WOOD, EPHYSICS_BODY_RESTITUTION_WOOD}
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif