KiCad PCB EDA Suite
Loading...
Searching...
No Matches
frustum_3d.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
28
29#ifndef _TRUNCATED_CONE_3D_H_
30#define _TRUNCATED_CONE_3D_H_
31
32#include "object_3d.h"
33
39{
40public:
48 TRUNCATED_CONE( SFVEC2F aCenterPoint, float aZmin, float aZmax, float aRadiusMin,
49 float aRadiusMax );
50
51 void SetColor( SFVEC3F aObjColor ) { m_diffusecolor = aObjColor; }
52
53 bool Intersect( const RAY& aRay, HITINFO& aHitInfo ) const override;
54 bool IntersectP( const RAY& aRay, float aMaxDistance ) const override;
55 bool Intersects( const BBOX_3D& aBBox ) const override;
56 SFVEC3F GetDiffuseColor( const HITINFO& aHitInfo ) const override;
57
58private:
60 float m_radiusMin; // Radius at Zmin
61 float m_radiusMax; // Radius at Zmax
62 float m_zMin;
63 float m_zMax;
64 float m_height; // zMax - zMin
65 float m_slope; // (radiusMax - radiusMin) / height
67};
68
69#endif // _TRUNCATED_CONE_3D_H_
OBJECT_3D(OBJECT_3D_TYPE aObjType)
Definition object_3d.cpp:40
bool Intersect(const RAY &aRay, HITINFO &aHitInfo) const override
bool IntersectP(const RAY &aRay, float aMaxDistance) const override
float m_radiusMax
Definition frustum_3d.h:61
SFVEC3F m_diffusecolor
Definition frustum_3d.h:66
SFVEC2F m_center
Definition frustum_3d.h:59
bool Intersects(const BBOX_3D &aBBox) const override
void SetColor(SFVEC3F aObjColor)
Definition frustum_3d.h:51
SFVEC3F GetDiffuseColor(const HITINFO &aHitInfo) const override
TRUNCATED_CONE(SFVEC2F aCenterPoint, float aZmin, float aZmax, float aRadiusMin, float aRadiusMax)
float m_radiusMin
Definition frustum_3d.h:60
Manage a bounding box defined by two SFVEC3F min max points.
Definition bbox_3d.h:43
Stores the hit information of a ray with a point on the surface of a object.
Definition hitinfo.h:36
Definition ray.h:63
glm::vec2 SFVEC2F
Definition xv3d_types.h:42
glm::vec3 SFVEC3F
Definition xv3d_types.h:44