Skip to content

ConeShape

class ConeShape : public Shape

A cone shape, defined by a radius and an height.

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.

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.