ConeShape¶
class ConeShape : public Shape
A cone shape, defined by a radius and an height.
Operators¶
Name | Description |
---|---|
operator== | Compares this shape with another shape for equality. |
operator!= | Compares this shape with another shape for inequality. |
Functions¶
Name | Description |
---|---|
Create | Creates a new ConeShape from a definition. |
ConeShape | Constructs a new ConeShape . |
GetRadius | Gets the radius of the cone shape. |
GetDiameter | Gets the diameter of the cone shape. |
GetHeight | Gets the height of the cone shape. |
SetRadius | Sets the radius of the cone shape. |
SetHeight | Sets the height of the cone shape. |
GetShortestDistanceToEdge | Gets the shortest distance to the edge of this shape. |
Contains | Checks if the given position is contained in this shape. |
Operator Details¶
operator!=¶
bool operator!=(const ConeShape& other) const
Compares this shape with another shape for inequality.
Note
Shapes are equal if they have the same dimensions, the position, and the same orientation.
- Parameter
other
- The other shape to compare with.
- Return
false
if the shapes are equal,true
otherwise.
operator==¶
bool operator==(const ConeShape& other) const
Compares this shape with another shape for equality.
Note
Shapes are equal if they have the same dimensions, the position, and the same orientation.
- Parameter
other
- The other shape to compare with.
- Return
true
if the shapes are equal,false
otherwise.
Function Details¶
ConeShape¶
explicit ConeShape(AmReal32 radius, AmReal32 height)
Constructs a new ConeShape
.
- Parameter
radius
- The radius of the cone's base.
- Parameter
height
- The height of the cone.
Contains¶
[[nodiscard]] bool Contains(const AmVec3& location) final
Checks if the given position is contained in this shape.
- Parameter
location
- The 3D position to check.
- Return
- true if the shape contains the given position, false otherwise.
Create¶
static ConeShape* Create(const ConeShapeDefinition* definition)
Creates a new ConeShape from a definition.
- Parameter
definition
- The definition of the shape generated from a flatbuffer binary.
Warning
This method is intended for internal usage only.
GetDiameter¶
[[nodiscard]] AmReal32 GetDiameter() const
Gets the diameter of the cone shape.
- Return
- The cone base's diameter.
GetHeight¶
[[nodiscard]] AmReal32 GetHeight() const
Gets the height of the cone shape.
- Return
- The cone's height.
GetRadius¶
[[nodiscard]] AmReal32 GetRadius() const
Gets the radius of the cone shape.
- Return
- The cone base's radius.
GetShortestDistanceToEdge¶
[[nodiscard]] AmReal32 GetShortestDistanceToEdge(const AmVec3& location) final
Gets the shortest distance to the edge of this shape.
- Parameter
location
- The location from which calculate the distance.
- Return
- The shortest distance from the location to the edge of this shape. If negative, the given location in outside the shape.
SetHeight¶
void SetHeight(AmReal32 height)
Sets the height of the cone shape.
- Parameter
height
- The cone's height.
SetRadius¶
void SetRadius(AmReal32 radius)
Sets the radius of the cone shape.
- Parameter
radius
- The cone base's radius.