forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from dragonpilot-community/tetoo
Tē-Tôo module
- Loading branch information
Showing
87 changed files
with
6,957 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dp_ext
updated
12 files
Submodule dp_priv
updated
from ca3c50 to 3a735b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
third_party/libspatialindex/larch64/include/spatialindex/Ball.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/****************************************************************************** | ||
* Project: libspatialindex - A C++ library for spatial indexing | ||
* Author: Peter Labadorf - plaba3.1415@gmail.com | ||
****************************************************************************** | ||
* Copyright (c) 2023, Peter Labadorf | ||
* | ||
* All rights reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#ifndef M_PI | ||
#define M_PI 3.14159265358979323846 | ||
#endif | ||
|
||
namespace SpatialIndex | ||
{ | ||
|
||
class SIDX_DLL Ball: public Tools::IObject, public virtual IShape | ||
{ | ||
public: | ||
Ball(); | ||
Ball(double radius, const Point& center); | ||
Ball(double radius, const double *pCoords, uint32_t dimension); | ||
Ball(const Ball& b); | ||
~Ball() override; | ||
|
||
virtual Ball& operator=(const Ball& b); | ||
virtual bool operator==(const Ball& b) const; | ||
|
||
// | ||
// IObject interface | ||
// | ||
|
||
Ball* clone() override; | ||
|
||
// | ||
// ISerializable interface | ||
// | ||
|
||
uint32_t getByteArraySize() override; | ||
void loadFromByteArray(const uint8_t *data) override; | ||
void storeToByteArray(uint8_t **data, uint32_t &length) override; | ||
|
||
// | ||
// IShape interface | ||
// | ||
|
||
bool intersectsShape(const IShape &in) const override; | ||
bool containsShape(const IShape &in) const override; | ||
bool touchesShape(const IShape &in) const override; | ||
void getCenter(SpatialIndex::Point &out) const override; | ||
uint32_t getDimension() const override; | ||
void getMBR(SpatialIndex::Region &out) const override; | ||
double getArea() const override; | ||
double getMinimumDistance(const IShape &in) const override; | ||
|
||
virtual bool containsLineSegment(const SpatialIndex::LineSegment *line) const; | ||
virtual bool containsRegion(const SpatialIndex::Region *region) const; | ||
|
||
inline bool containsPoint(const Point *point) const | ||
{ | ||
return getMinimumDistance(*point) <= m_centerPoint.m_dimension; | ||
} | ||
|
||
inline bool containsBall(const Ball *ball) const | ||
{ | ||
return getMinimumDistance(ball->m_centerPoint) + ball->m_radius <= m_radius; | ||
} | ||
|
||
public: | ||
double m_radius{0.0}; | ||
Point m_centerPoint; | ||
|
||
}; // Ball | ||
|
||
SIDX_DLL std::ostream& operator<<(std::ostream& os, const Ball& ball); | ||
|
||
} | ||
|
Oops, something went wrong.