NcEngine
nc::Shape Struct Reference

Describes collision geometry for physics types. More...

#include <Shape.h>

Public Member Functions

auto GetLocalScale () const -> const Vector3 &
 
auto GetAssetId () const -> asset::AssetId
 
auto GetType () const -> ShapeType
 

Static Public Member Functions

static constexpr auto MakeBox (const Vector3 &extents=Vector3::Splat(1.0f)) -> Shape
 Make a primitive box shape.
 
static constexpr auto MakeSphere (float radius=0.5f) -> Shape
 Make a primitive sphere shape.
 
static constexpr auto MakeCapsule (float height=2.0f, float radius=0.5f) -> Shape
 Make a primitive capsule shape.
 
static constexpr auto MakeConvexHull (asset::AssetId assetId, const Vector3 &scale=Vector3::One()) -> Shape
 Make a shape from a ConvexHull asset.
 
static constexpr auto MakeMesh (asset::AssetId assetId, const Vector3 &scale=Vector3::One()) -> Shape
 Make a shape from a MeshCollider asset. More...
 
static constexpr auto MakeCompound (asset::AssetId assetId, float scale=1.0f) -> Shape
 Make a shape from a CompoundShape asset.
 

Detailed Description

Describes collision geometry for physics types.

Member Function Documentation

◆ MakeMesh()

static constexpr auto nc::Shape::MakeMesh ( asset::AssetId  assetId,
const Vector3 scale = Vector3::One() 
) -> Shape
inlinestaticconstexpr

Make a shape from a MeshCollider asset.

Note
MeshColliders are only compatible with BodyType::Static.

The documentation for this struct was generated from the following file: