Defines a 3D shape with Type and data disposed in a union-like structure. All shapes have a UserTag, BroadRadius and Centroid. All non-compound shapes have a LocalTransform and their Centroid always match their local transform position.
More...
|
const int | SIZE = SHAPE_DATA + BoxShape.SIZE |
| The size of the struct in bytes. More...
|
|
Defines a 3D shape with Type and data disposed in a union-like structure. All shapes have a UserTag, BroadRadius and Centroid. All non-compound shapes have a LocalTransform and their Centroid always match their local transform position.
◆ CreateSphere()
Creates a 3D sphere shape defined by a radius .
- Parameters
-
- Returns
- A Shape3D with the setup and type of a SphereShape.
◆ CreateBox()
Creates a 3D box shape defined by extents .
- Parameters
-
extents | The extents of the box, a vector that defines the distance from the box centroid to the furthest point in the positive direction of each axis. |
posOffset | The position offset of the shape in the Shape3D.LocalTransform. |
rotOffset | The rotation offset of the shape in the Shape3D.LocalTransform. |
- Returns
- A Shape3D with the setup and type of a BoxShape.
◆ CreateCapsule()
Creates a 3D capsule shape.
- Parameters
-
radius | Radius of the cylinder and semi-spheres that compose the capsule. |
extent | Distance from the center of the capsule to the top of the internal cylinder. This is NOT the capsule Height. |
Height = 2 * (Radius + Extent)
Extent = (Height / 2) - Radius
- Parameters
-
posOffset | Offset of the center of the capsule relative to its collider or query position. |
rotOffset | Rotation offset of the capsule relative to its collider or query rotation. |
- Returns
◆ CreatePersistentCompound()
static Shape3D Quantum.Shape3D.CreatePersistentCompound |
( |
| ) |
|
|
inlinestatic |
Creates a compound shape that composed by a group of other 3D shapes (including other compounds).
- Returns
- A Shape3D with the setup and type of an CompoundShape3D.
◆ GetLocalSupport()
Computes a point on the shape which has the highest dot product in a given direction (localDir ), both in the local space of the shape.
- Parameters
-
f | Current frame. |
localDir | The direction, in local space, in which to compute the support point. |
skipNormalize | If the provided direction is already normalized. |
- Returns
- A point, in the local space of the shape, which has the highest dot product in the given direction.
◆ Serialize()
static void Quantum.Shape3D.Serialize |
( |
void * |
ptr, |
|
|
FrameSerializer |
serializer |
|
) |
| |
|
inlinestatic |
Serializes a Shape3D into a FrameSerializer.
- Parameters
-
ptr | The pointer to the Shape3D. |
serializer | The FrameSerializer instance into which the struct will be serialized. |
◆ GetHashCode()
override int Quantum.Shape3D.GetHashCode |
( |
| ) |
|
|
inline |
Overrides the hash code generation of this type.
- Returns
- A hash code of the current state of this instance.
◆ SIZE
const int Quantum.Shape3D.SIZE = SHAPE_DATA + BoxShape.SIZE |
|
static |
The size of the struct in bytes.
◆ UserTag
UInt16 Quantum.Shape3D.UserTag |
Set a number tag to identify a shape.
◆ LocalTransform
The offset position and rotation of the shape related to the entity's transform.
◆ Centroid
The offset position of the shape center related to the entity's position.
◆ Compound
◆ BroadRadius
FP Quantum.Shape3D.BroadRadius |
The radius of an abstract circle that rounds the shape. Used to check the possibility of collision.
◆ Mesh
◆ Sphere
◆ Box
◆ Capsule
◆ Terrain
◆ Type
Returns the type of the shape.