Skip to main content

Module physics_editor

Module physics_editor 

Source

Structs§

Aabb
AngularConstraint
ArcPoint
BallSocketConstraint
BroadPhase
BvhNode
ClothParamsPanel
ClothParticle
ClothSimulation
ClothSpring
CollisionShapeEditor
ConeTwistConstraint
ConstraintSolver
ContactManifold
ContactPoint
ContactStats
ContactVisualizer
ConvexHull3D
ConvexHullFace
DOF6Drive
DebrisParticle
DestructionPanel
Differential
DistanceConstraint
DynamicAabbTree
EngineTorqueCurve
ExplosionWave
FixedConstraint
FluidParamsPanel
FluidSimulation
ForceAnalyzer
ForcePlate
FractureRng
Simple LCG random number generator for reproducible fracture
GearBox
GearConstraint
Generic6DOFConstraint
GjkSimplex
HeightfieldShape
HingeConstraint
JacobianRow
JointDrive
JointEditor
JointVisualizer
LimitConstraint
MaterialEditorPanel
MotorConstraint
MotorVelocityController
Obb
PendulumChain
PhysicsDebugOverlay
PhysicsEditor
PhysicsEditorLayout
PhysicsMaterial
PhysicsPicker
PhysicsPropertyCurve
PhysicsSnapshot
PhysicsStats
PhysicsWorldSettings
PneumaticSpring
PointToPointConstraint
PulleyConstraint
RackAndPinionConstraint
RagdollBone
RagdollEditor
RagdollJoint
RagdollPanel
RigidBodyInspector
SapEndpoint
ShallowWaterSim
ShapeParameters
SimulationReplay
SliderConstraint
SoftBody
SoftBodyNode
SoftBodySpring
SphParticle
SpringConstraint
StabilityAnalyzer
TriggerVolume
VehicleParamsPanel
VehiclePhysics
VoronoiCell
VoronoiFracture
WeldConstraint
WheelState
WindField

Enums§

BroadphaseType
ClothSpringType
CollisionShapeType
Constraint
CurveLoopMode
DifferentialType
DriveForceMode
EngineType
JointGizmoMode
MaterialSortBy
PhysicsEditorCommand
PhysicsTab
RagdollBlendMode
RigidBodyShapeType
SurfaceType

Constants§

AIR_DENSITY
ALUMINUM_DENSITY
CONCRETE_DENSITY
COPPER_DENSITY
DEFAULT_FRICTION
DEFAULT_RESTITUTION
DEG_TO_RAD
EPSILON
GLASS_DENSITY
GOLD_DENSITY
GRAVITY
HALF_PI
ICE_DENSITY
PI
RAD_TO_DEG
RUBBER_DENSITY
SAND_DENSITY
SLEEP_ANGULAR_THRESHOLD
SLEEP_LINEAR_THRESHOLD
SPH_POLY6_COEFF
SPH_SPIKY_COEFF
SPH_VISC_COEFF
STEEL_DENSITY
TWO_PI
WATER_DENSITY
WOOD_DENSITY

Functions§

ackermann_steering
Compute Ackermann steering angles for inner and outer wheel L = wheelbase, W = track width, delta = steering angle (outer)
angular_correction_impulse
Compute the angular impulse needed to align two coordinate frames
angular_velocity_from_delta_quat
Compute angular velocity from rotation delta over dt
anisotropic_friction
baumgarte_position_correction
Solve a 1D position constraint (Baumgarte): return position correction
build_material_library
buoyancy_force
Compute buoyancy force on a submerged object F_b = rho_fluid * V_submerged * g
compute_compound_com
Compute the center of mass of a compound body
compute_compound_inertia
Compute combined inertia for a compound body using parallel axis theorem
compute_convex_hull_2d
Compute convex hull (gift wrapping / Jarvis march) in 2D projection Then extrude in 3D for approximate convex hull vertices
cross_matrix
Cross product matrix (skew symmetric) for angular dynamics
decompose_swing_twist
drag_force
Drag force: F_d = 0.5 * rho * v^2 * Cd * A
effective_radius
Effective radius for two spheres in contact 1/R_eff = 1/R_a + 1/R_b
effective_young_modulus
Effective Young’s modulus for two materials in contact (Hertz) 1/E_eff = (1-nu_a^2)/E_a + (1-nu_b^2)/E_b
epa_sphere_sphere
EPA (Expanding Polytope Algorithm) — compute penetration depth and normal Simplified version for sphere vs sphere
fabrik_solve
FABRIK N-bone chain solver
feet_to_meters
fit_aabb_to_triangles
Fit an AABB to a set of triangles
fit_obb_pca
Fit an OBB to a point cloud using PCA approximation Finds principal axes from covariance matrix (3x3 symmetric Jacobi)
friction_impulse
Compute friction impulse (Coulomb friction cone)
ftlb_to_nm
gjk_intersect
gjk_intersect_box_box
Simple GJK (line simplex and triangle tests inline)
gram_schmidt
Gram-Schmidt orthonormalization of three vectors
heightfield_closest_point
hertz_contact_force
Hertz contact force: F = (4/3) * E_eff * sqrt(R_eff) * delta^(3/2)
hertz_contact_time
Approximate collision time from material properties (Hertz contact) t_contact ~ 2.87 * (m / (E_eff * v_rel))^(2/5)
horsepower_to_watts
impact_force
Compute impact force from collision (impulse-momentum) F = m * delta_v / delta_t
inertia_parallel_axis
Parallel axis theorem: shift inertia tensor by displacement d I_new = I_cm + m*(|d|^2I3 - dd^T)
inertia_tensor_box
Compute inertia tensor for a solid box (principal moments) Ixx = (1/12)m(h^2 + d^2), Iyy = (1/12)m(w^2 + d^2), Izz = (1/12)m(w^2 + h^2)
inertia_tensor_capsule
Compute inertia tensor for a capsule (cylinder + two hemispheres) Capsule aligned along Y axis
inertia_tensor_cone
Compute inertia tensor for a solid cone aligned along Y axis Ixx = Izz = (3/80)m(4*r^2 + h^2), Iyy = (3/10)mr^2
inertia_tensor_cylinder
Compute inertia tensor for a solid cylinder aligned along Y axis Ixx = Izz = (1/12)m(3*r^2 + h^2), Iyy = (1/2)mr^2
inertia_tensor_sphere
Compute inertia tensor for a solid sphere I = (2/5)mr^2 (all principal moments equal)
jacobi_eigen_3x3
Simple Jacobi eigendecomposition for symmetric 3x3 matrix Returns (eigenvalues, eigenvectors as Vec3)
joules_to_kwh
kg_to_pounds
kinetic_energy
Kinetic energy of a rigid body
kph_to_ms
kwh_to_joules
mat3_det
3x3 determinant
mat3_inverse
3x3 matrix inverse
mat3_mul
Multiply two 3x3 matrices
mat3_mul_vec
Multiply 3x3 matrix by vector
mat3_transpose
Transpose 3x3 matrix
material_restitution
mesh_center_of_mass
Compute mesh center of mass (uniform density)
mesh_inertia_tensor
Compute mesh inertia tensor (uniform density, about origin)
mesh_signed_volume
Compute signed volume of a triangle mesh (divergence theorem)
mesh_surface_area
Compute mesh surface area
meters_to_feet
mph_to_ms
ms_to_kph
ms_to_mph
nm_to_ftlb
omega_to_quat_deriv
Convert angular velocity vector to quaternion derivative
pa_to_psi
pacejka_dry_asphalt
Pacejka coefficients for typical dry asphalt
pacejka_ice
Pacejka coefficients for ice
pacejka_magic_formula
Pacejka Magic Formula tire model F = D * sin(C * atan(Balpha - E(Balpha - atan(Balpha))))
pacejka_wet_road
Pacejka coefficients for wet road
perpendicular_to
poisson_ratio
Poisson’s ratio table
potential_energy
Potential energy (gravitational)
pounds_to_kg
psi_to_pa
quat_to_axis_angle
rads_to_rpm
ray_aabb_intersect
relative_velocity
Compute relative velocity of two points on two rigid bodies
resolve_collision_impulse
restitution_between
Coefficient of restitution between two materials
restitution_velocity
Restitution-based rebound velocity
rolling_friction_torque
rpm_to_rads
run_physics_editor_smoke_test
screen_to_world_ray
set_rigid_body_velocity
smoothstep
snap_value
sph_kernel_poly6
Poly6 kernel W(r,h) = (315/64πh^9)*(h^2-r^2)^3 for |r|<=h
sph_kernel_poly6_grad
Gradient of Poly6 kernel
sph_kernel_poly6_lap
Laplacian of Poly6 kernel
sph_kernel_spiky_grad
Spiky kernel gradient (for pressure) — W_spiky = (15/πh^6)*(h-|r|)^3
sph_kernel_viscosity_lap
Viscosity kernel laplacian: W_lap = (15/(2πh^3))*(-(r^3/2h^3) + r^2/h^2 + h/(2r) - 1)
sphere_heightfield_contact
spring_potential_energy
Spring potential energy
stribeck_friction
support_box
GJK support function for a box
support_minkowski
Minkowski difference support function
support_sphere
GJK support function for a convex shape (sphere)
surface_friction_coefficient
terminal_velocity
Compute terminal velocity for an object falling through air v_t = sqrt(2mg / (rho * Cd * A))
transform_rigid_body
two_bone_ik
2-bone analytical IK solve
watts_to_horsepower
world_to_screen
young_modulus
Young’s modulus table (Pa)