Host typegenerated
Physics3d
Independent 3D physics controls, indexed queries and copied last-step events. Requires a 3D physics host. Controls require an active body. Before synchronization, valid authored 3D bodies with nonempty primitive colliders or convex-model references accept ordered setters/impulses. Convex asset geometry, scaled hull mass and pending controls validate at scene synchronization; replay uses actual compound mass. Unconsumed requests expire after successful synchronization. Authored motion fields are unchanged, so structural rebuilds restore authored settings.
24 members · engine 0.1.0
Physics3d.angular_velocity(entity: Entity) -> Vec3Copied world-space Vec3 angular velocity in radians per second around XYZ. Before synchronization returns the last queued setter or authored starting velocity; rotation locking returns zero.Physics3d.apply_impulse(entity: Entity, impulse: Vec3) -> unitApplies a finite world-space Vec3 impulse to an active dynamic body using its compound mass; queues before synchronization and resolves in call order at materialization. Invalid input or body kind fails before mutation; does not change authored starting motion.Physics3d.apply_impulse_at(entity: Entity, impulse: Vec3, point: Vec3) -> unitApplies a finite world-space Vec3 impulse through a finite world-space Vec3 point on an active dynamic body: off its centre of mass it turns the body as well as pushing it, the way a thruster mounted at one end of a ship does. Queues before synchronization like apply_impulse and resolves in call order; invalid input or body kind fails before mutation.Physics3d.cast_box(origin: Vec3, half_extents: Vec3, rotation_axis: Vec3, rotation_angle: number, direction: Vec3, max_distance: number, mask: number, include_sensors: bool, exclude: Entity?) -> RayHit3d?Indexed active 3D shape query. Positive Vec3 half-extents define the box. Sweeps return copied RayHit3d or null with fixed orientation and nonzero normalized direction; travel is non-negative and the endpoint finite. Finite f32-range values are required. A nonzero Vec3 rotation_axis is normalized and rotation_angle is radians about it using the right-hand rule. Uses the ray membership mask, sensor opt-in and whole-entity exclusion. Overlaps are sorted unique copied Entity lists; casts retain initial-overlap and deterministic tie semantics. Does not step physics.Physics3d.cast_capsule(origin: Vec3, half_height: number, radius: number, rotation_axis: Vec3, rotation_angle: number, direction: Vec3, max_distance: number, mask: number, include_sensors: bool, exclude: Entity?) -> RayHit3d?Indexed active 3D shape query. The local-Y capsule has non-negative straight-segment half_height and positive radius; zero half-height is a sphere. Sweeps return copied RayHit3d or null with fixed orientation and nonzero normalized direction; travel is non-negative and the endpoint finite. Finite f32-range values are required. A nonzero Vec3 rotation_axis is normalized and rotation_angle is radians about it using the right-hand rule. Uses the ray membership mask, sensor opt-in and whole-entity exclusion. Overlaps are sorted unique copied Entity lists; casts retain initial-overlap and deterministic tie semantics. Does not step physics.Physics3d.cast_sphere(origin: Vec3, radius: number, direction: Vec3, max_distance: number, mask: number, include_sensors: bool, exclude: Entity?) -> RayHit3d?Closest fixed-orientation sphere sweep as a copied RayHit3d or null. Positive finite radius, finite Vec3 origin/direction, normalized nonzero direction and non-negative distance in engine f32 range; endpoint must remain finite. Point is world contact, distance is probe travel. Initial overlap returns origin, zero distance and zero normal. Uses indexed synchronized geometry and the ray filter, skipping inactive/despawned entities. No rotation or physics step; extreme finite geometry still has the engine's documented numerical limitations.Physics3d.character_motion(entity: Entity) -> CharacterMotion3d?Copied CharacterMotion3d from the last completed controller step, or null before a result exists or for an inactive/non-controller entity. Requires scene character context. Classified support, raw movement and carry remain separate; repeated reads do not drain results. Inactive ground, platform and collision references are filtered; historical translation and raw backend flags remain unchanged. Editing copies never changes simulation or queued movement.Physics3d.collision_started() -> List<Entity>Sorted unique other active entities that started solid contact with this script's entity in the last successful 3D step. All scripts observe the same snapshot without draining it.Physics3d.collision_stopped() -> List<Entity>Sorted unique other active entities that stopped solid contact with this script's entity in the last successful 3D step. Removed or inactive handles are filtered.Physics3d.joint_enabled(joint: Entity) -> boolReads the authored enabled flag of a 3D distance joint, including before synchronization. True does not guarantee live endpoints: missing, inactive or bodiless endpoints still suspend the constraint. Requires 3D physics and a sindri.physics3d.distance_joint on the owner.Physics3d.layer(name: String) -> numberQuery mask bit for a text name in the active authored 3D world's first 32 layer labels. Empty labels cannot be selected; duplicate names select the first bit. Reads current authoring without stepping; ignores inactive settings and never reads 2D names. Unknown names, malformed or multiple active world settings and missing 3D host fail.Physics3d.mask(names: List<String>) -> numberCombines Physics3d.layer bits from a List<str> using bitwise OR. Repeated names do not add bits; an empty list returns zero. Every name is checked; non-text elements, unknown names, invalid active world settings or missing 3D host fail.Physics3d.move_character(entity: Entity, displacement: Vec3, snap: bool) -> unitQueues finite world-space Vec3 displacement for an active authored Character 3D at the next fixed step, including before first synchronization. Last valid request wins; invalid requests preserve it. Snap only enables the authored snap distance. Requires scene character context, valid settings/transform and no competing body/controller. Scene synchronization validates scaled solid geometry before movement. Gameplay owns gravity, speed and jump policy; events observe the moved pose on the following solver step.Physics3d.overlap_box(centre: Vec3, half_extents: Vec3, rotation_axis: Vec3, rotation_angle: number, mask: number, include_sensors: bool, exclude: Entity?) -> List<Entity>Indexed active 3D shape query. Positive Vec3 half-extents define the box. Finite f32-range values are required. A nonzero Vec3 rotation_axis is normalized and rotation_angle is radians about it using the right-hand rule. Uses the ray membership mask, sensor opt-in and whole-entity exclusion. Overlaps are sorted unique copied Entity lists; casts retain initial-overlap and deterministic tie semantics. Does not step physics.Physics3d.overlap_capsule(centre: Vec3, half_height: number, radius: number, rotation_axis: Vec3, rotation_angle: number, mask: number, include_sensors: bool, exclude: Entity?) -> List<Entity>Indexed active 3D shape query. The capsule lies along local Y before rotation; half_height is the non-negative half-length of its straight segment and radius is positive. Zero half-height is a sphere. Finite f32-range values are required. A nonzero Vec3 rotation_axis is normalized and rotation_angle is radians about it using the right-hand rule. Uses the ray membership mask, sensor opt-in and whole-entity exclusion. Overlaps are sorted unique copied Entity lists; casts retain initial-overlap and deterministic tie semantics. Does not step physics.Physics3d.overlap_sphere(centre: Vec3, radius: number, mask: number, include_sensors: bool, exclude: Entity?) -> List<Entity>Sorted unique copied Entity list overlapping a finite Vec3 centre and positive finite f32-range radius. Uses indexed synchronized geometry, membership mask, sensor opt-in and whole-entity exclusion; inactive/despawned entities are filtered. Does not step physics.Physics3d.raycast(origin: Vec3, direction: Vec3, max_distance: number, mask: number, include_sensors: bool, exclude: Entity?) -> RayHit3d?Closest indexed 3D ray hit as a copied RayHit3d or null. Finite Vec3 origin/direction and non-negative finite f32-range distance are required; direction is normalized and the endpoint must remain finite. Whole-u32 mask selects memberships, sensors opt in and an Entity or null excludes all pieces of one entity. Skips inactive/despawned entities. Inside/on hits have distance zero and zero normal; exact ties prefer entity then piece order. Queries synchronized geometry without stepping physics.Physics3d.sensor_entered() -> List<Entity>Sorted unique other active entities that entered sensor contact with this script's entity in the last successful 3D step. Discrete events do not guarantee fast trigger sweeps; the snapshot is not drained.Physics3d.sensor_exited() -> List<Entity>Sorted unique other active entities that left sensor contact with this script's entity in the last successful 3D step. Removed or inactive handles are filtered; the snapshot is not drained.Physics3d.set_angular_velocity(entity: Entity, velocity: Vec3) -> unitSets finite Vec3 angular velocity in radians per second around world XYZ on an active dynamic or velocity-kinematic body; queues before synchronization after validating authored body/colliders. Rotation-locked bodies retain zero angular velocity. Invalid input fails before mutation; does not change authored starting motion.Physics3d.set_distance(joint: Entity, max_distance: number) -> unitTunes the length of an authored 3D distance joint (a rope) for the next fixed synchronization: shorten it step by step to reel a body in. Distance must be finite and positive. Works while suspended or before endpoints are built; keeps the solver constraint, its anchors and body motion. Requires 3D physics and a sindri.physics3d.distance_joint on the owner.Physics3d.set_joint_enabled(joint: Entity, enabled: bool) -> unitSuspends or reconnects an authored 3D distance joint at the next fixed synchronization: let go of a rope, then catch on it again. Keeps the owner, endpoints, length, anchors and body motion. Requires 3D physics and a sindri.physics3d.distance_joint on the owner.Physics3d.set_velocity(entity: Entity, velocity: Vec3) -> unitSets finite world-space Vec3 linear velocity on an active dynamic or velocity-kinematic body; queues before synchronization after validating authored body/colliders. Invalid inputs fail before mutation; does not change authored starting motion.Physics3d.velocity(entity: Entity) -> Vec3Copied world-space Vec3 linear velocity. Before synchronization returns the last queued setter or authored starting velocity; impulses resolve only after mass is known.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b