public override void CreatePhysics(IPhysicsBody physicsBody) { const double radius = 0.5, // mech legs collider meleeHitboxHeight = 0.7, meleeHitboxOffset = 0.25, rangedHitboxHeight = 1.4, rangedHitboxOffset = 0; physicsBody.AddShapeCircle( radius / 2, center: (-radius / 2, 0)); physicsBody.AddShapeCircle( radius / 2, center: (radius / 2, 0)); physicsBody.AddShapeRectangle( size: (radius, radius), offset: (-radius / 2, -radius / 2)); // melee hitbox physicsBody.AddShapeRectangle( size: (0.8, meleeHitboxHeight), offset: (-0.4, meleeHitboxOffset), group: CollisionGroups.HitboxMelee); // ranged hitbox physicsBody.AddShapeRectangle( size: (0.8, rangedHitboxHeight), offset: (-0.4, rangedHitboxOffset), group: CollisionGroups.HitboxRanged); }
public override void CreatePhysics(IPhysicsBody physicsBody) { // human legs collider var radius = 0.2; physicsBody.AddShapeCircle( radius / 2, center: (-radius / 2, 0)); physicsBody.AddShapeCircle( radius / 2, center: (radius / 2, 0)); physicsBody.AddShapeRectangle( size: (radius, radius), offset: (-radius / 2, -radius / 2)); // melee hitbox physicsBody.AddShapeRectangle( size: (0.6, MeleeHitboxHeight), offset: (-0.3, MeleeHitboxOffset), group: CollisionGroups.HitboxMelee); // ranged hitbox physicsBody.AddShapeRectangle( size: (0.5, RangedHitboxHeight), offset: (-0.25, RangedHitboxOffset), group: CollisionGroups.HitboxRanged); }
public override void CreatePhysics(IPhysicsBody physicsBody) { const double radius = LegsColliderRadius; physicsBody.AddShapeCircle( radius / 2, center: (-radius / 2, 0), CollisionGroups.CharacterOrVehicle); physicsBody.AddShapeCircle( radius / 2, center: (radius / 2, 0), CollisionGroups.CharacterOrVehicle); physicsBody.AddShapeRectangle( size: (radius, radius), offset: (-radius / 2, -radius / 2), CollisionGroups.CharacterOrVehicle); // melee hitbox physicsBody.AddShapeRectangle( size: (0.6, MeleeHitboxHeight), offset: (-0.3, MeleeHitboxOffset), group: CollisionGroups.HitboxMelee); // ranged hitbox physicsBody.AddShapeRectangle( size: (0.5, RangedHitboxHeight), offset: (-0.25, RangedHitboxOffset), group: CollisionGroups.HitboxRanged); }
public virtual void CreatePhysics(IPhysicsBody physicsBody) { // default skeleton physics (for test only, must be overridden in inherited classes) var radius = 0.2; physicsBody.AddShapeCircle( radius, center: (-radius / 2, 0)); // melee hitbox (circle) physicsBody.AddShapeCircle( radius * 1.5, center: (-radius / 2, radius / 1.5), group: CollisionGroups.HitboxMelee); // ranged hitbox (circle) physicsBody.AddShapeCircle( radius * 2, center: (-radius / 2, radius), group: CollisionGroups.HitboxRanged); }