From a2112b11f0d12127c4db97c5c4868af3bc34313f Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Fri, 4 Mar 2011 20:31:57 +0000 Subject: [PATCH] added missing file capsule.h for DX11ClothDemo Thanks to Cameron, see Issue 486. --- Demos/DX11ClothDemo/capsule.h | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Demos/DX11ClothDemo/capsule.h diff --git a/Demos/DX11ClothDemo/capsule.h b/Demos/DX11ClothDemo/capsule.h new file mode 100644 index 000000000..32482dc25 --- /dev/null +++ b/Demos/DX11ClothDemo/capsule.h @@ -0,0 +1,67 @@ +#include "cap.h" +#include "cylinder.h" + + +class capsule +{ + public: + + cap topCap; + cap bottomCap; + cylinder coreCylinder; + + double x_offset, y_offset, z_offset; + + int width; + int height; + bool top; + + btCollisionShape *collisionShape; + btCollisionObject *collisionObject; + + void set_collision_object(btCollisionObject* co) + { + collisionObject = co; + topCap.set_collision_object( co ); + bottomCap.set_collision_object( co ); + coreCylinder.set_collision_object( co ); + } + + void set_collision_shape(btCollisionShape* cs) + { + collisionShape = cs; + topCap.set_collision_shape( cs ); + bottomCap.set_collision_shape( cs ); + coreCylinder.set_collision_shape( cs ); + } + + void create_texture(void) + { + topCap.create_texture(); + bottomCap.create_texture(); + coreCylinder.create_texture(); + } + + void destroy() + { + topCap.destroy(); + bottomCap.destroy(); + coreCylinder.destroy(); + } + + void draw(void) + { + topCap.draw(); + bottomCap.draw(); + coreCylinder.draw(); + } + + + // paddingFactor is the amount of padding to allow the capsule collider around the + void create_buffers(int width_, int height_) + { + topCap.create_buffers(width_, height_, true); + bottomCap.create_buffers(width_, height_, false); + coreCylinder.create_buffers(width_, height_); + } +};