Struct Collider¶
-
struct Collider¶
Public Functions
-
inline void setShapeType(ShapeType newType)¶
Changes the shape type, the size is kept and folded into the new shape.
-
inline void setHalfExtend(const fm_vec3_t &newHalfExtend)¶
Resizes the current shape from a half-extend box, keeping the shape type.
Axes a shape has no use for are folded in, e.g. a cylinder takes its radius from max(x, z) and its half height from y. Negative values are mirrored.
-
inline const fm_vec3_t &halfExtend() const¶
Size of the collider in the owner’s local space, as set by any of the setters.
-
inline void setSphereShape(float radius)¶
Makes this a sphere collider of the given size.
- Parameters:
radius – The radius of the sphere
-
inline void setBoxShape(const fm_vec3_t &halfSize)¶
Makes this a box collider of the given size.
- Parameters:
halfSize – The half size vector of the box
-
inline void setCapsuleShape(float radius, float innerHalfHeight)¶
Makes this a capsule collider of the given size (‘innerHalfHeight’ excludes the round caps).
- Parameters:
radius – The radius of the capsule
innerHalfHeight – The half height of the capsule’s cylindrical part
-
inline void setCylinderShape(float radius, float halfHeight)¶
Makes this a cylinder collider of the given size.
- Parameters:
radius – The radius of the cylinder
halfHeight – The half height of the cylinder
-
inline void setConeShape(float radius, float halfHeight)¶
Makes this a cone collider of the given size.
- Parameters:
radius – The radius of the cone’s base
halfHeight – The half height of the cone
-
inline void setPyramidShape(float baseHalfWidthX, float baseHalfWidthZ, float halfHeight)¶
Makes this a pyramid collider of the given size.
- Parameters:
baseHalfWidthX – Half the width of the base along the X axis
baseHalfWidthZ – Half the width of the base along the Z axis
halfHeight – Half the height of the pyramid along the Y axis
-
inline void setParentOffset(const fm_vec3_t &newParentOffset)¶
Moves the shape’s center relative to the owner’s origin, in the owner’s local space.
-
inline const fm_vec3_t &parentOffset() const¶
-
inline const SphereShape &worldSphereShape() const¶
-
inline const CapsuleShape &worldCapsuleShape() const¶
-
inline const CylinderShape &worldCylinderShape() const¶
-
inline const PyramidShape &worldPyramidShape() const¶
-
inline void setBounce(float newBounce)¶
-
inline float bounce() const¶
-
inline void setFriction(float newFriction)¶
-
inline float friction() const¶
-
inline void setTrigger(bool newIsTrigger)¶
-
inline bool isTrigger() const¶
-
inline void setCollisionMask(uint8_t newReadMask, uint8_t newWriteMask)¶
-
inline uint8_t readMask() const¶
-
inline uint8_t writeMask() const¶
-
inline const fm_vec3_t &worldCenter() const¶
-
inline uint32_t worldStateVersion() const¶
-
fm_vec3_t support(const fm_vec3_t &dir) const¶
-
AABB boundingBox(const Matrix3x3 &rotation) const¶
Same box as the quaternion overload, for callers that already hold the rotation matrix.
-
fm_vec3_t inertiaTensor(float mass) const¶
-
fm_vec3_t toWorldSpace(const fm_vec3_t &localPoint) const¶
-
fm_vec3_t toLocalSpace(const fm_vec3_t &worldPoint) const¶
-
fm_vec3_t rotateToWorld(const fm_vec3_t &localDir) const¶
-
fm_vec3_t rotateToLocal(const fm_vec3_t &worldDir) const¶
-
bool hasOwnerTransformChanged() const¶
-
void syncOwnerTransform()¶
-
bool syncFromRigidBody(const fm_vec3_t &rbPosition, const fm_quat_t &rbRotation)¶
-
bool syncWorldState()¶
-
bool readsMeshCollider(const MeshCollider *other) const¶
Public Members
-
SphereShape sphere_¶
-
CapsuleShape capsule_¶
-
CylinderShape cylinder_¶
-
PyramidShape pyramid_¶
-
inline void setShapeType(ShapeType newType)¶