1#ifndef __SF3_PHYSICS_MODEL__
2#define __SF3_PHYSICS_MODEL__
6#define SF3_FORMAT_ID_PHYSICS_MODEL 0x06
118 const char *base = (
char*)shape;
144 default:
return "Unknown";
152 for(uint16_t i=0; i<physics_model->
shape_count; ++i){
155 const void *start = (
const void *)physics_model;
156 const void *end = (
const void *)shape;
SF3_EXPORT size_t sf3_physics_model_size(const struct sf3_physics_model *physics_model)
Computes the size of the physics model file in bytes.
sf3_physics_shape_type
The shape types that can be stored in a physics model.
@ SF3_PHYSICS_SHAPE_PILL
The shape is an sf3_shape_pill.
@ SF3_PHYSICS_SHAPE_MESH
The shape is an sf3_shape_mesh.
@ SF3_PHYSICS_SHAPE_BOX
The shape is an sf3_shape_box.
@ SF3_PHYSICS_SHAPE_ELLIPSOID
The shape is an sf3_shape_ellipsoid.
@ SF3_PHYSICS_SHAPE_CYLINDER
The shape is an sf3_shape_cylinder.
SF3_INLINE const struct sf3_physics_shape * sf3_physics_model_next_shape(const struct sf3_physics_shape *shape)
The basic header structure of every SF3 file.
uint16_t shape_count
The number of shapes that comprise the model.
float mass
The mass of the entire model in Kg.
struct sf3_physics_shape shapes[]
A box shape described by the half-widths along the principal axes.
float w
The half-size in X.
float d
The half-size in Z.
float h
The half-size in Y.
A cylindrical shape described by two radii and a half-height.
float bottom_radius
The radius of the cap in Y-.
float top_radius
The radius of the cap in Y+.
float height
The half-size in Y.
float w
The radius along X.
float d
The radius along Z.
float h
The radius along Y.
A convex hull described by its edge vertices.
uint16_t count
The number of vertices stored.
float vertices[]
The vertices described as triplets of X, Y, Z coordinates.
A pill-box shape described by two radii and a half-height.
float bottom_radius
The radius of the sphere in Y-.
float height
The half-size in Y between the two spheres.
float top_radius
The radius of the sphere in Y+.