Table of Contents

Struct Sphere

Namespace
Box3D
Assembly
Box3D.NET.dll

A sphere, positioned relative to the body it is attached to.

public readonly record struct Sphere : IEquatable<Sphere>

Implements

Inherited Members

Examples

// A ball of radius half a metre, centred on the body origin.
body.AddSphere(new Sphere(0.5f));

// A wheel hub offset from the body origin.
body.AddSphere(new Sphere(new Vector3(0.0f, -0.4f, 0.0f), 0.2f));

Constructors

Sphere(Vector3, float)

Initializes a new instance of the Box3D.Sphere struct.

Sphere(float)

Initializes a new instance centred on the body origin.

Properties

Center

Gets the centre, relative to the body origin.

Radius

Gets the radius.