Skip to content

CreatePhysicsDistanceConstraint

Narta Xaymar Dirks edited this page Nov 17, 2026 · 1 revision
BlitzLLVM

CreatePhysicsDistanceConstraint 〔BlitzLLVM〕

CreatePhysicsDistanceConstraint:Int32 a:Int32, b:Int32, x:Float32, y:Float32, z:Float32, min_distance:Float32, max_distance:Float32
Parameter Mode Type Default Description
a In Int32 required The first body (a physics body entity). Limits, angles, speeds and positions of the constraint are those of this body relative to the second.
b In Int32 required The second body, or 0 to hold the first body against the world.
x In Float32 required The point on the second body (or of the world), x.
y In Float32 required That point, y.
z In Float32 required That point, z.
min_distance In Float32 required The smallest distance, 0 or more.
max_distance In Float32 required The largest distance, at least the smallest.

Returns: The handle of the constraint.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Keeps one point of the first body (where its origin is now) and a point of the second body (or of the world) between a smallest and a largest distance of each other, like a rope or a rod. Equal distances make a rod. PhysicsConstraintSpring makes the stops soft, PhysicsConstraintLimits changes the distances.

A constraint needs bodies in the same physics world and at least one body that can move (dynamic). It is gone when either body is freed or the world is freed. All points and directions are in the world. Free it with FreePhysicsConstraint.

Differences

  • The original has no such command. This is an extension; programs that use it do not compile with the original Blitz3D.

Related Commands

CreatePhysicsBody 〔BlitzLLVM〕, CreatePhysicsBodyFromEntity 〔BlitzLLVM〕, CreatePhysicsConeConstraint 〔BlitzLLVM〕, CreatePhysicsFixedConstraint 〔BlitzLLVM〕, CreatePhysicsHingeConstraint 〔BlitzLLVM〕, CreatePhysicsPointConstraint 〔BlitzLLVM〕, CreatePhysicsSliderConstraint 〔BlitzLLVM〕, CreatePhysicsWorld 〔BlitzLLVM〕

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally