cylindertrigger.c 627 B

12345678910111213141516171819202122232425
  1. //! Trigger with cylinder shape
  2. class CylinderTrigger : Trigger
  3. {
  4. override void EOnInit(IEntity other, int extra)
  5. {
  6. SetCollisionCylinder(1, 0.5);
  7. }
  8. #ifdef DEVELOPER
  9. override protected Shape DrawDebugShape(vector pos, vector min, vector max, float radius, int color)
  10. {
  11. float height = max[1];
  12. Shape dbgShape = Debug.DrawCylinder(Vector(0, height * 0.5, 0), radius, height, color, ShapeFlags.TRANSP|ShapeFlags.NOZWRITE|ShapeFlags.DOUBLESIDE);
  13. vector mat[4];
  14. GetTransform( mat );
  15. dbgShape.CreateMatrix( mat );
  16. dbgShape.SetMatrix( mat );
  17. dbgTargets.Insert( dbgShape );
  18. return dbgShape;
  19. }
  20. #endif
  21. };