stdlib/physics3dView source ↗
physics3d
22 items · generated by scribe fromstdlib/physics3d.fd· synced 2026-11-15
Contents
- COLLIDER_SPHERE: (const)
- Sphere (struct)
- Aabb3 (struct)
- Plane3 (struct)
- RigidBody3 (struct)
- phys3d_create_body (function)
- phys3d_create_sphere (function)
- phys3d_create_static_plane (function)
- phys3d_set_gravity (function)
- phys3d_get_gravity (function)
- phys3d_apply_force (function)
- phys3d_apply_impulse (function)
- phys3d_apply_gravity (function)
- phys3d_step (function)
- Contact3 (struct)
- phys3d_sphere_vs_sphere (function)
- phys3d_aabb_vs_aabb (function)
- phys3d_sphere_vs_plane (function)
- phys3d_sphere_vs_aabb (function)
- phys3d_resolve_contact (function)
- phys3d_check_collision (function)
- phys3d_resolve_all (function)
COLLIDER_SPHERE:
pub const COLLIDER_SPHERE: i64 = 0; pub const COLLIDER_BOX: i64 = 1; pub const COLLIDER_PLANE: i64 = 2;Defined at line 26
Sphere
pub struct Sphere {Fields:
| Name | Type |
|---|---|
center | vec3 |
radius | f64 |
Defined at line 27
Aabb3
pub struct Aabb3 {Fields:
| Name | Type |
|---|---|
min | vec3 |
max | vec3 |
Defined at line 32
Plane3
pub struct Plane3 {Fields:
| Name | Type |
|---|---|
normal | vec3 |
distance | f64 |
Defined at line 37
RigidBody3
pub struct RigidBody3 {Fields:
| Name | Type |
|---|---|
position | vec3 |
velocity | vec3 |
acceleration | vec3 |
force | vec3 |
mass | f64 |
inv_mass | f64 |
restitution | f64 |
friction | f64 |
is_static | bool |
collider_type | i64 |
sphere | Sphere |
box | Aabb3 |
radius | f64 |
half_extents | vec3 |
Defined at line 44
phys3d_create_body
pub fn phys3d_create_body(pos: vec3, half_ext: vec3, mass: f64) -> RigidBody3 {Parameters:
pos:vec3half_ext:vec3mass:f64
Returns: RigidBody3
Defined at line 66
phys3d_create_sphere
pub fn phys3d_create_sphere(pos: vec3, radius: f64, mass: f64) -> RigidBody3 {Parameters:
pos:vec3radius:f64mass:f64
Returns: RigidBody3
Defined at line 80
phys3d_create_static_plane
pub fn phys3d_create_static_plane(normal: vec3, distance: f64) -> RigidBody3 {Parameters:
normal:vec3distance:f64
Returns: RigidBody3
Defined at line 94
phys3d_set_gravity
pub fn phys3d_set_gravity(g: vec3) -> void {Parameters:
g:vec3
Returns: void
Defined at line 107
phys3d_get_gravity
pub fn phys3d_get_gravity() -> vec3 {Returns: vec3
Defined at line 113
phys3d_apply_force
pub fn phys3d_apply_force(body: & mut RigidBody3, force: vec3) -> void {Parameters:
body:& mut RigidBody3force:vec3
Returns: void
Defined at line 117
phys3d_apply_impulse
pub fn phys3d_apply_impulse(body: & mut RigidBody3, impulse: vec3) -> void {Parameters:
body:& mut RigidBody3impulse:vec3
Returns: void
Defined at line 121
phys3d_apply_gravity
pub fn phys3d_apply_gravity(body: & mut RigidBody3, dt: f64) -> void {Parameters:
body:& mut RigidBody3dt:f64
Returns: void
Defined at line 128
phys3d_step
pub fn phys3d_step(body: & mut RigidBody3, dt: f64) -> void {Parameters:
body:& mut RigidBody3dt:f64
Returns: void
Defined at line 137
Contact3
pub struct Contact3 {Fields:
| Name | Type |
|---|---|
normal | vec3 |
depth | f64 |
point | vec3 |
has_contact | bool |
Defined at line 166
phys3d_sphere_vs_sphere
pub fn phys3d_sphere_vs_sphere(a: & RigidBody3, b: & RigidBody3) -> Contact3 {Parameters:
a:& RigidBody3b:& RigidBody3
Returns: Contact3
Defined at line 177
phys3d_aabb_vs_aabb
pub fn phys3d_aabb_vs_aabb(a: & RigidBody3, b: & RigidBody3) -> Contact3 {Parameters:
a:& RigidBody3b:& RigidBody3
Returns: Contact3
Defined at line 201
phys3d_sphere_vs_plane
pub fn phys3d_sphere_vs_plane(sphere: & RigidBody3, plane: & RigidBody3) -> Contact3 {Parameters:
sphere:& RigidBody3plane:& RigidBody3
Returns: Contact3
Defined at line 268
phys3d_sphere_vs_aabb
pub fn phys3d_sphere_vs_aabb(sphere: & RigidBody3, box_body: & RigidBody3) -> Contact3 {Parameters:
sphere:& RigidBody3box_body:& RigidBody3
Returns: Contact3
Defined at line 294
phys3d_resolve_contact
pub fn phys3d_resolve_contact(a: & mut RigidBody3, b: & mut RigidBody3, contact: & Contact3) -> void {Parameters:
a:& mut RigidBody3b:& mut RigidBody3contact:& Contact3
Returns: void
Defined at line 347
phys3d_check_collision
pub fn phys3d_check_collision(a: & RigidBody3, b: & RigidBody3) -> Contact3 {Parameters:
a:& RigidBody3b:& RigidBody3
Returns: Contact3
Defined at line 422
phys3d_resolve_all
Resolve all collisions in a list of bodies (brute force, O(n^2)).
pub fn phys3d_resolve_all(bodies: & mut Vec<RigidBody3>, dt: f64) -> void {Parameters:
bodies:& mut Vec<RigidBody3>dt:f64
Returns: void
Defined at line 452
Generated by scribe, the Fides documentation generator