Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpObstructionManager.h
/* Copyright (C) 2021 Wildfire Games. | /* Copyright (C) 2022 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Calculate the largest straight line distance between the source and the target | * Calculate the largest straight line distance between the source and the target | ||||
*/ | */ | ||||
virtual fixed MaxDistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const = 0; | virtual fixed MaxDistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const = 0; | ||||
/** | /** | ||||
* Check if the given entity is in range of the other point given those parameters. | * Check if the given entity is in range of the other point given those parameters. | ||||
* @param maxRange - if -1, treated as infinite. | * @param maxRange - Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE. | ||||
*/ | */ | ||||
virtual bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | virtual bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | ||||
/** | /** | ||||
* Check if the given entity is in range of the target given those parameters. | * Check if the given entity is in range of the target given those parameters. | ||||
* @param maxRange - if -1, treated as infinite. | * @param maxRange - Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE. | ||||
*/ | */ | ||||
virtual bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | virtual bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | ||||
/** | /** | ||||
* Check if the given entity is in parabolic range of the target given those parameters. | |||||
* @param maxRange - Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE. | |||||
*/ | |||||
virtual bool IsInTargetParabolicRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, bool opposite) const = 0; | |||||
/** | |||||
* Check if the given point is in range of the other point given those parameters. | * Check if the given point is in range of the other point given those parameters. | ||||
* @param maxRange - if -1, treated as infinite. | * @param maxRange - Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE. | ||||
*/ | */ | ||||
virtual bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const = 0; | virtual bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const = 0; | ||||
/** | /** | ||||
* Check if the given shape is in range of the target shape given those parameters. | * Check if the given shape is in range of the target shape given those parameters. | ||||
* @param maxRange - if -1, treated as infinite. | * @param maxRange - Can be a nonnegative decimal, ALWAYS_IN_RANGE or NEVER_IN_RANGE. | ||||
*/ | */ | ||||
virtual bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | virtual bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | ||||
/** | /** | ||||
* Collision test a flat-ended thick line against the current set of shapes. | * Collision test a flat-ended thick line against the current set of shapes. | ||||
* The line caps extend by @p r beyond the end points. | * The line caps extend by @p r beyond the end points. | ||||
* Only intersections going from outside to inside a shape are counted. | * Only intersections going from outside to inside a shape are counted. | ||||
* @param filter filter to restrict the shapes that are counted | * @param filter filter to restrict the shapes that are counted | ||||
▲ Show 20 Lines • Show All 348 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator